About 2,560,000 results
Open links in new tab
  1. javascript - Simple example on how to use Websockets between …

    Nov 14, 2018 · Just a note, socket.io is a backend/frontend library that uses websocket but also has a number of fallbacks if the client browser does not support websocket. The example below works with ws backend. Server

  2. javascript - websocket.send() parameter - Stack Overflow

    Jul 12, 2019 · Send message through websocket using javascript. 1. WS websocket send() as a function. 0.

  3. How to wait for a WebSocket's readyState to change

    Nov 25, 2012 · I'm trying to implement a WebSocket with a fallback to polling. If the WebSocket connection succeeds, readyState becomes 1, but if it fails, readyState is 3, and I should begin polling. I tried

  4. javascript - WebSocket Connection timeout - Stack Overflow

    no, timeout is for each try. So calling initWebsocket() with timeout = 5000 and numberOfRetries = 5 means that it is tried to open to websocket, waited for max. 5 seconds and if opening the websocket is not successful in this time period, the attempt is aborted and a new try is started.

  5. javascript - WebSocket: How to automatically reconnect after it …

    This isn't explicitly a react question but here is a react style answer: TLDR: You can use setInterval to periodically check the websocket connection status and try to re-connect if the connection is closed.

  6. javascript - Intercept WebSocket messages - Stack Overflow

    Dec 2, 2021 · Apparently the WebSocket object is now a JavaScript class instead of a plain old prototype, and some modern websites really don't like it if you override the class and turn it back into a prototype. Thankfully, you can just create a new …

  7. javascript - What is a WebSocket Subprotocol? - Stack Overflow

    May 7, 2021 · Sec-WebSocket-Protocol: soap. The server can't send more than one Sec-Websocket-Protocol header. If the server doesn't want to use any subprotocol, it shouldn't send any Sec-WebSocket-Protocol header. Sending a blank header is incorrect. The client may close the connection if it doesn't get the subprotocol it wants.

  8. javascript - websockets - get message from a websocket server …

    May 31, 2018 · Basically, I will have websocket consumers to get trade data. And within same host (localhost for now) there will be a websocket server. This websocket server will send data to each client websockets. SUCCESS: Ok I made it by defining consumer websocket (binanceWS) message listener in websocket server connection. I am not sure if this is a good ...

  9. javascript - WebSocket connection failed: Error during WebSocket ...

    Dec 30, 2016 · It seems that even though the Websocket connection establishes correctly (indicated by the 101 Switching Protocols request), it still defaults to long-polling. The fix was as simple as adding this option to the Socket.io connection function: {transports: ['websocket']} So the code finally looks like this:

  10. javascript - Websocket onerror - how to read error description?

    Sep 14, 2013 · I've been developing browser-based multi player game for a while now and I've been testing different ports accessibility in various environment (client's office, public wifi etc.). All is going quite

Refresh