Comments (7)
Shameless plug, but I recommend using Caddy as your reverse proxy for this. Caddy has Automatic HTTPS, it can fetch certs from Let's Encrypt or ZeroSSL automatically. And you can use request matchers to decide to proxy to socketi instead of your PHP (or whatever) app if the request looks like websockets.
Example config, works for your standard Laravel app:
example.com {
log
@ws {
header Connection *Upgrade*
header Upgrade websocket
}
handle @ws {
reverse_proxy socketi:6001
}
handle {
root * /srv/public
encode gzip
php_fastcgi php-fpm:9000
file_server
}
}
@rennokki feel free to add this to the docs 👍
from soketi.
@xiCO2k Thank you for promoting Caddy here! Your reply has resulted in my entirely dropping nginx on my webserver and migrating everything, including the the reverse proxy for my websocket setup. This is so beautiful:
ws.mydomain.example {
reverse_proxy 127.0.0.1:6001
@websockets {
header Connection *Upgrade*
header Upgrade websocket
}
reverse_proxy @websockets 127.0.0.1:6001
}
from soketi.
In your case @elbojoloco since you're using the same upstream for both websockets and non-websockets, you don't need the @websockets
matcher at all. Just do this:
ws.mydomain.example {
reverse_proxy 127.0.0.1:6001
}
from soketi.
In your case @elbojoloco since you're using the same upstream for both websockets and non-websockets, you don't need the
@websockets
matcher at all. Just do this:ws.mydomain.example { reverse_proxy 127.0.0.1:6001 }
Wow, amazing.. thanks for the tip!
from soketi.
what if I want to listen for private IP only?
Trying to understand this. Do you mean how to keep soketi non-public and use it just internally, for your other services?
And just want to know if this package would be better with or without reverse proxy like Nginx
Both are good. Adding reverse proxy adds some latency, but solves some configurational burdens when running in shared hosting with another backend app, especially for SSL.
from soketi.
@rennokki Yes, I want to put the websocket service for private use and also I want to have another one for public use but It's going to be behind Nginx, but the problem is the websocket service is listening to "0.0.0.0" or all interface, I want to know if it's possible to set which interface to listen to, like for the the one behind nginx will we "127.0.0.1" and the one for private will be "PRIVATE_IP"
from soketi.
HOST
environment variable. It's not documented, I guess 😓
from soketi.
Related Issues (20)
- [BUG] Same port bug and or bug behind kubernetes LB? HOT 2
- [REQUEST] Statistic Collection for Dashboard project (link inside)
- soketi exec_curl error: "OpenSSL/1.1.1u: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure"
- [DOCUMENTATION] Docker tag 1-16-alpine does not work slash does not exist HOT 1
- [REQUEST] Heroku deployment example HOT 1
- the Soketi project is abandoned HOT 9
- [BUG] webhook Message event handler not implemented HOT 2
- configuration of ssl on server HOT 3
- How to install soketi in windows 11 HOT 9
- Sorry, you have been blocked HOT 1
- [BUG] dash.soketi.app is down (522) HOT 5
- Cannot read properties of undefined (reading 'includes') HOT 2
- [BUG] Cannot get users count for presence channels HOT 1
- [REQUEST] ability to use SSL for mysql
- [REQUEST] Implement watchlist
- [REQUEST] Preventing down docker server
- [BUG] Socketi Dashboard Down HOT 1
- Has anyone managed to run Soketi on FreeBSD?
- The JS client connects but Pusher's official Java client does not.
- [BUG] Not found any messages saved in Redis when change adapter driver to redis
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soketi.