You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a small script to bridge between Elm and WebSockets. I have done this in other Elm apps which do not use create-elm-app without problem. However, when I use create-elm-app, the url I provide gets rewritten.
Results in: WebSocket connection to 'ws://localhost:3000/sockjs-node/631/03d4psaf/websocket' failed: WebSocket is closed before the connection is established.
As can be seen, something is interfering with setting up the WebSocket. The url is prepended with a partially random string.
After googling, I suspect this has something to do with Webpack which uses SockJs for hot reloading. This might be therefore be unsolvable, it is just how JavaScript works, if someone decides to intercept something, then everyone is hit.
But if I am wrong, I really like to know how to avoid the URL rewrite.
The text was updated successfully, but these errors were encountered:
Is this a bug report?
No, this is a call for help.
I have a small script to bridge between Elm and WebSockets. I have done this in other Elm apps which do not use create-elm-app without problem. However, when I use create-elm-app, the url I provide gets rewritten.
const ws = new WebSocket(protocol + "//" + host + "/websocket");
Results in:
WebSocket connection to 'ws://localhost:3000/sockjs-node/631/03d4psaf/websocket' failed: WebSocket is closed before the connection is established.
As can be seen, something is interfering with setting up the WebSocket. The url is prepended with a partially random string.
After googling, I suspect this has something to do with Webpack which uses SockJs for hot reloading. This might be therefore be unsolvable, it is just how JavaScript works, if someone decides to intercept something, then everyone is hit.
But if I am wrong, I really like to know how to avoid the URL rewrite.
The text was updated successfully, but these errors were encountered: