-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Dynamic server address:port for the client websocket #508
base: master
Are you sure you want to change the base?
Conversation
Hello @vladkol thank you very much for this PR. I'm not sure to understand the use case. |
Hello @dddomodossola, thank you for looking at my PR, and for an awesome library! What users deal with is a load balancing/front door service, such is Cloud CDN in GCP, Cloud Front in AWS, and Front Door in Azure. Depending the host name (and sometimes even the pathname!) of the URL, such service routes the traffic to different internal networks and server nodes. Those are not some special cases, but recommended ways of exposing services to the Internet. Even when you are hosting a single-node server, the traffic goes through multiple physical and virtual networks. The simplest web app in the cloud normally doesn't have a reserved IP-address, so the hostname of the URL may be resolved to a different IP for different users. All this situations can be handled by using the actual in-browser URL when connecting to the webscocket. I came up with this change simply because otherwise remi doesn't work when the server is running in a container in App Engine, Kubernetes Engine or Cloud Run. My previous experience with other clouds tells be the same issue will happen there. |
Thank you very much for the explanation. I like your changes 😉 |
Great! Let me know if you need anything else before you merge it. |
In remote access scenarios, the server often is not aware of the URL, IP address and port the users will be accessing it. It happens when the server is running behind a load balancer, dynamically allocated IP address, etc.
This PR adds
dynamic_web_address
to thestart
function as well as to theServer
class.When
dynamic_web_address
isTrue
, the javascript client code takes the host address and port fromdocument.location
property.The original behavior stays by default, so the existing code should run as it is.