New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Host Config & Reverse Proxy #297
Comments
Trying to understand this. Do you mean how to keep soketi non-public and use it just internally, for your other services?
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. |
@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" |
|
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:
@rennokki feel free to add this to the docs 👍 |
@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:
|
In your case @elbojoloco since you're using the same upstream for both websockets and non-websockets, you don't need the
|
Wow, amazing.. thanks for the tip! |
I've tried this package, but it seems I can't decide which interface I want to listen to when starting the service like what if I want to listen for private IP only?
And just want to know if this package would be better with or without reverse proxy like Nginx
The text was updated successfully, but these errors were encountered: