Skip to content
Advertisement

Tag: websocket

disconnect client from socket.io id

I can connect specific player to specific room like: And documentation says that ‘you can use leave method to leave room’ like: But I just want any client to leave using io object instead of socket. I need something like: Is there any way to leave client from room using just socket id with io object? Answer As @tresdin mentioned,

Reactjs: how to share a websocket between components

I’m new to React and I’m having some issues regarding components structure and sharing a websocket between them. The app consists of categories and products. The initial data load will be done with an Ajax request and a websocket will be used keep data updated. My component hierarchy looks like this: CategoriesList Category ProductsList Product CategoriesList holds the state of

Client Socket.io disconnects and reconnects to websocket persistently

I am connected via Socket.io 1.3.4 (via websockets) to the NodeJS server and client socket.io fires up “disconnect” event 5-30 seconds. Every “disconnect”->”reconnecting”->”reconnect” iteration takes approx. 2 seconds. I am connected via cable to pretty stable network. Server is hosted on AWS. Sometimes I have bad Wi-Fi connection, but no “disconnect” event fire up at all. How can I debug

Socket.io not sending cookies in the handshake causing the request to stall

Let me explain my setup. I have multiple domain names that are all CNAME records for a main domain name, such as example.com. example.com -> serverIP company1.example.com -> example.com company2.example.com -> example.com I’m basically developing white labeled versions of our software, where the software simply detects the referrer and knows which logos and stylesheet assets to load. So that is

Java Server Socket transfer String to web socket

My goal is to set up a connection between a Java Server Socket and a browser (using web sockets). So far, the connection works, but my data streams do not. I would like to send a String from the server socket to the web socket. The problems are the input and output streams. The web socket sends “zustimmung” to the

Check if my website is open in another tab

I want to check with JavaScript if the user has already opened my website in another tab in their browser. It seems I cannot do that with pagevisibility… The only way I see is to use WebSocket based on a session cookie, and check if the client has more than one socket. But by this way, from current tab, I

Javascript websockets closing immediately after opening

The connection to the server is established and an alert is displayed for Connection open! However immediately afterwards the connection closes. The server does not call close and there seem to be no other errors in the console. This is happening in both chrome and firefox. I looked at a bunch of different similar examples on the web but to

Advertisement