theia works well when used ipaddress like http://my.ip.add.ress:3000
Now, I set a proxy server https://sub.mydomain.tld to http://my.ip.add.ress:3000 and things get wrong.
On the chrome console, i get this message
WebSocket connection to 'ws://ide.gsunitedtechnologies.com/services' failed: Error during WebSocket handshake: Unexpected response code: 404 v @ index.js:123
Event bubbles: false cancelBubble: false cancelable: false composed: false currentTarget: WebSocket {url: "ws://ide.gsunitedtechnologies.com/services", readyState: 3, bufferedAmount: 0, onopen: null, onerror: 茠, 鈥 defaultPrevented: false eventPhase: 0 isTrusted: true path: [] returnValue: true srcElement: WebSocket {url: "ws://ide.gsunitedtechnologies.com/services", readyState: 3, bufferedAmount: 0, onopen: null, onerror: 茠, 鈥 target: WebSocket {url: "ws://ide.gsunitedtechnologies.com/services", readyState: 3, bufferedAmount: 0, onopen: null, onerror: 茠, 鈥 timeStamp: 947.5099999981467 type: "error" __proto__: Event
OS and Theia version:
OS: Ubuntu 16.04 LTS
Theia Version : 0.11.0
Diagnostics:
I don't think we do anything special with web sockets in Theia. You will need to have a look into your proxy configuration. Maybe @geropl can have an idea?
I just have installed theia in docker container behind apache proxy, here is my config:
<IfModule mod_ssl.c>
<VirtualHost *:443>
DocumentRoot /srv/www
ServerName subdomain.server.com
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://localhost:3000/$1 [P,L]
...
</VirtualHost>
</IfModule>
haven't tested everything yet, but seems ok so far
He doesn't work for me..
I just have installed theia in docker container behind apache proxy, here is my config:
<IfModule mod_ssl.c> <VirtualHost *:443> DocumentRoot /srv/www ServerName subdomain.server.com RewriteEngine On RewriteCond %{HTTP:Upgrade} =websocket [NC] RewriteRule /(.*) ws://localhost:3000/$1 [P,L] RewriteCond %{HTTP:Upgrade} !=websocket [NC] RewriteRule /(.*) http://localhost:3000/$1 [P,L] ... </VirtualHost> </IfModule>haven't tested everything yet, but seems ok so far
That's exactly the right solution. it works without issue. I did it with nginx directives, updated the code below.
@vanilla-thunder
The direct solutions is considering this as a websocket proxy. what you did seems to be working without issues. I tested with nginx as well.
For nginx,
location / {
proxy_pass http://0.0.0.0:8080/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
Most helpful comment
@vanilla-thunder
The direct solutions is considering this as a websocket proxy. what you did seems to be working without issues. I tested with nginx as well.
For nginx,