I am having an issue with the socket connection with my ionic3 application. I am using socket for implementing chat. Please find the below work flow.
I have configured the socket.io in my dashboard moudule (Not on app.module.ts) because I have to pass user token while connection which is obtained only after login. I have added screenshot below. Here I am getting success socket connection with the server.
When I import the socket in my chat page, I am getting the below error.
Is there any mistake in my approach? If my question is not clear to you please comment below before downvoting.
Related
This is the error that I am getting on console while firing an event using tinker.
I am able to connect to XXXs.XXX.com:8443/laravel-websockets, where I can see the default channel and socketId is being created.
The socket has been deployed on nginx server. Server is secured with the whitelisting and blacklisting IPs/Urls. The project is running on XXXs.XXX.com:8443 port and on same the websocket is running on XXXs.XXX.com:6001 port.
For the pusher credentials, I am using: PUSHER_APP_ID=MY_ID, PUSHER_APP_KEY='MY_KEY', PUSHER_APP_SECRET=MY_SECRET,
Also the certificate has been attached, and hence no issue while connecting to socket.
Since there's no issue on local system, so I doubt there is some server/system related issue, but unable to find one.
We are working on the ASP.Net core API application. In this application, we have a SignalR module for notification. We planned to host the application in the AWS environment. We have used the AWS lambda service to host the API, and also the WebSocket API gateway to consume the notification/SignalR part.
We are facing an issue with connecting the notification URL.
When we tried to connect the Web socket URL from Commandline using Node, it is showing "Unexpected server response 403".
When we tried to consume the URL from the frontend application, it showed the below error.
"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled. ."
We are stuck with this issue. Any help to resolve this issue would be appreciable.
NestJS 8, socket.io 4
Client user has a socket being able to receive data from the server. Not sending.
Refresh browser, the socket ID changed. Socket on the client receive 'connect' event! Yet. On server side, no logging at all. Which kind of explained point 1.
After reboot nest, problem is gone. But it comes back eventually.
My current troubleshooting direction is
Was the connection on the client dead already and it's still trying somehow to update the socket?
Browser does some caching, service worker?
I hope someone can enlighten. This happens after upgrade to socket.io 4 from 2.
It's my own stupidity.
My tenant who own the namespace. In order to reach him, I create his namespace and send message to it no matter he's online or offline.
This works fine in socket.io 2. I don't know why.
What I should do, is to check whether or not, the namespace exists or not first.
That's why the issue that I have is that the server somehow seems able to pipe message to the namespace, yet the tenant cannot send the message to the server because the tenant was not initialized properly in the nest gateway.
I am currently developing a tizen app using a web app.
I have a problem with web socket communication, but I can not tell which part is the problem.
Is there anybody who can help with this?
try port number 9000,3000,8080
WebSocket connection to 'ws://localhost:3000/' failed: Error in
connection establishment: net::ERR_CONNECTION_REFUSED
Could you check this guide page for Tizen Websocket?
https://developer.tizen.org/ko/development/guides/web-application/w3chtml5supplementary-features/communication/websocket
I think.. If you add some codes, it will be helpful to others.
I am creating an application using Flask-SocketIO at the server side and a javascript Socket.IO client. (There will also be a Python client later). I want to ensure users are authenticated before they connect to the web socket server.
I have created a PHP login form to check the username and password. If these are valid then a unique token is returned and the token is also inserted into a table on the server. The token is passed to the client side javascript, where it is submitted with the request to create a web socket connection.
As I understand it Flask-SocketIO will simply accept the connection and I need to put my validation code under the #socketio.on('connect') decorator. (I assume a server based implementation of Socket.IO works in a similar way). Therefore my code checks the submitted token against the database table and if it is valid the web socket connection is simply allowed to happen. However if the token is not valid I issue a disconnect() command. The javascript client does not try the connection again, which is what I want in this scenario.
Here is where it gets tricky...
I would like to write a disconnect handler on the client side using socket.on('disconnect', function() { //do something }); to allow the user to reconnect when the socket is broken due to a poor mobile connection for example. How can I distinguish an accidental disconnection from an intentional one due to failed validation?
Conversely, I would like to alert the user to the fact that their validation process failed. But how to distinguish that from a scenario where the the socket is broken due to a poor mobile connection?
I would like to write a disconnect handler on the client side using socket.on('disconnect', function() { //do something }); to allow the user to reconnect when the socket is broken due to a poor mobile connection for example.
There is no need for you to worry about reconnection. The Socket.IO client protocol includes reconnection support and will always try to reconnect when the connection is lost. To verify this, start your server, connect with a client, and then kill your server. A little bit later restart the server and you will see that in a matter of seconds the connection is reestablished.