stakwork / sphinx-kotlin-core

MIT License
0 stars 2 forks source link

fix socket.io not connecting to the right url path #21

Closed antonilol closed 1 year ago

antonilol commented 1 year ago

i have my relay behind an apache2 proxy example: relay at localhost:3000 example.com/sphinx proxied to localhost:3000 relay url in the app: example.com/sphinx all requests work except socketio, that tried to connect to example.com/socket.io, but has to connect to example.com/sphinx/socket.io to get through the proxy and end up at localhost:3000/socket.io i fixed this by adding a path option to socket io. it takes the path from the relay url

tested with the desktop app (sphinx-kotlin-ui) at aed9a646e4a26de0539f530c2edb7e47404ff0ec

antonilol commented 1 year ago

"The path represents the Namespace, and not the actual path (see below) of the HTTP requests" https://socketio.github.io/socket.io-client-java/initialization.html i removed the path from the url before giving it to socket io in 9a9231e this namespace thing prevented the websocket from connecting and socket io falling back to polling, which did not work great but did not give and error in the log so i assumed at first socket io's websocket connected