W wl Well-Known Member Licensed User Longtime User Nov 13, 2016 #1 Hi, I have a test websocket application (websocket class called /connector) that works when connected directly. Now I put a caddy webserver as a reverse proxy in between: caddyfile: Code: Copy mydomain.com { proxy / http://192.168.0.2:8080 { websocket } } The B4J server is running on 192.168.0.2 port 80 When I connect using this caddyfile my B4J server crashes: Code: Copy at org.eclipse.jetty.server.HttpChannelOverHttp.upgrade(HttpChannelOverHttp.java:373)java.lang.NullPointerException When I remove the "websocket" in the caddyfile, the main page gets loaded, but as soon as the websocket is opened my browser returns an error (and thus the websocket is not working). Anyone any idea ? I think it is caused by the embed jetty server, as found here: http://stackoverflow.com/questions/...ocketfactory-upgrade-on-embedded-jetty-8-1-12 But I don't know how to fix it. Thanks Thanks ! Last edited: Nov 13, 2016
Hi, I have a test websocket application (websocket class called /connector) that works when connected directly. Now I put a caddy webserver as a reverse proxy in between: caddyfile: Code: Copy mydomain.com { proxy / http://192.168.0.2:8080 { websocket } } The B4J server is running on 192.168.0.2 port 80 When I connect using this caddyfile my B4J server crashes: Code: Copy at org.eclipse.jetty.server.HttpChannelOverHttp.upgrade(HttpChannelOverHttp.java:373)java.lang.NullPointerException When I remove the "websocket" in the caddyfile, the main page gets loaded, but as soon as the websocket is opened my browser returns an error (and thus the websocket is not working). Anyone any idea ? I think it is caused by the embed jetty server, as found here: http://stackoverflow.com/questions/...ocketfactory-upgrade-on-embedded-jetty-8-1-12 But I don't know how to fix it. Thanks Thanks !
Erel B4X founder Staff member Licensed User Longtime User Nov 15, 2016 #2 wl said: I think it is caused by the embed jetty server, as found here: Click to expand... Doesn't seem to be related to the proxy issue. WebSocket proxy is more complicated than regular http proxy. wl said: When I connect using this caddyfile my B4J server crashes: Click to expand... Does it really crash or on the connection throws an error? Check this issue: https://github.com/rancher/rancher/issues/4278 Looks like the fix was committed at September: https://github.com/mholt/caddy/pull/713 Make sure to use the latest version of Caddy. Note that as an alternative you can redirect the browser to the B4J server port. Upvote 0
wl said: I think it is caused by the embed jetty server, as found here: Click to expand... Doesn't seem to be related to the proxy issue. WebSocket proxy is more complicated than regular http proxy. wl said: When I connect using this caddyfile my B4J server crashes: Click to expand... Does it really crash or on the connection throws an error? Check this issue: https://github.com/rancher/rancher/issues/4278 Looks like the fix was committed at September: https://github.com/mholt/caddy/pull/713 Make sure to use the latest version of Caddy. Note that as an alternative you can redirect the browser to the B4J server port.