-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Docker Launcher: Websockets are unable to comunicate with the wsagent when the server and the browser run on different networks #1644
Comments
@l0rd browser and Che server use the same URL to reach ws-agent. Do you propose a different mechanism? Smth like being able to set these endpoints separately for server and client (browser)? Or the browser should use URL currently in the address bar (localhost in your case)? |
@l0rd normally, setting CHE_DOCKER_MACHINE_HOST is enough to run Che on a remote Linux machine. |
Also, we have started working on a way to proxy all requests through a single nginx proxy. This work will be done quickly and would be a way to hide the server and workspaces on different interfaces and ip addresses with nginx being external. It would be simpler overall, right? |
@TylerJewell I believe @l0rd means smth slightly different. While nginx solves the problem of ports exposure, it does not seem to solve host problem where Che server and browser use the same URL to reach ws-agent. @garagatyi should have his say here. |
Yeah I understood his configuration, but I am questioning if we should consider the use case and instead ask agent ip to be consistently applied inside the workspace and then allow nginx to handle the nuances of the internal mapping. I totally understand that he wants to address the docker for Mac scenario where nginx would apply, but just question the scenario generally. |
From the point of view of a user the URL on the address bar is the perfect Your solution @TylerJewell would work too but is more complicated imho. By the way have you looked at traefikproxy? That's the modern reverse proxy On Monday, 4 July 2016, Tyler Jewell [email protected] wrote:
|
@skabashnyuk - check out this reverse proxy. It is very cool. Perfect for Che. Mario - the work that we need for setting up reverse proxy is internal to Che. Inside of Codenvy we have a mechanism to allow the workspace ip and ephemeral ports to be embedded into the track back URL that the Che server passes back to the browser. We are going to update Che with this logic so that users can have it activated. If activated then the browser will need to talk to a proxy that can decode it. |
I don't think that having different URL for apps in the containers for Che master and browser is easier than proxy. |
I'm not sure that a reverse proxy alone would resolve this particular issue. Let's imagine that we have setup a reverse proxy in front of Che:
The websocket is configured to connect to CHE_DOCKER_MACHINE_HOST but it's not able to ping that IP address. This is reproducible with Docker for Mac but imo that's not the only scenario. There are two way to address that issue:
Overlay network is a distinct subject: it simplifies communications between server and agent in distributed environments (there is no need to retrieve IP addresses anymore) but do not simplify the communication to/from the browser (that would be outside the overlay network). |
Can we remove the milestone and add sprint/next-sprint? |
In scenarios where a
wsagent
has two different IP addresses:the creation of a new workspace and project fails.
I could reproduce that using Docker for Mac but the scenario should be reproducible wherever you have an internal/external IPs (e.g. amazon EC2). There is a workaround (rerouting the traffic to the internal IP address to the external IP address on the Docker host) and it's described here. This issue is about removing the need to use this workaround and is related to #1482.
Reproduction Steps:
lo0
aliasExpected behavior:
The workspace and project should be created successfully. The websocket should use the URL in the address bar to contact the wsagent (with a different port).
Observed behavior:
The creations hangs after the wsagent is started:
And after a few minutes a popup message with the following error:
Opening the developers tools in Chrome I could see that the websocket is tring to connect to an host (
192.168.65.2
) that is not accessible from the Mac OS and that is different from the host I've put in the brwoser address bar (localhost
)Che version: 4.4.0-RC1-SNAPSHOT
OS and version: Mac 10.11.5
Docker version:
Che install: Docker container
Additional information:
The text was updated successfully, but these errors were encountered: