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
_socket = new SocketIOClient.SocketIO("http://localhost:9099", new SocketIOOptions
{
ExtraHeaders = new Dictionary<string, string>
{
{ "token", "1234561" },
},
});
On the server side, the netty-socketio library is used. It has a verification method. Once the verification fails, it will return an HTTP response with the HTTP code 401 and close the connection. The code is roughly as follows:
HttpResponse res = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.UNAUTHORIZED); // Return a 401
channel.writeAndFlush(res).addListener(ChannelFutureListener.CLOSE); // Close the connection
I also don't receive any messages in the OnError method.
The problem now is that I cannot get this 401. In other words, I cannot know that the reason for the connection closing is a verification failure. In this case, I will still try to reconnect.
client version 3.1.1
thanks
The text was updated successfully, but these errors were encountered:
Client code:
_socket = new SocketIOClient.SocketIO("http://localhost:9099", new SocketIOOptions
{
ExtraHeaders = new Dictionary<string, string>
{
{ "token", "1234561" },
},
});
On the server side, the netty-socketio library is used. It has a verification method. Once the verification fails, it will return an HTTP response with the HTTP code 401 and close the connection. The code is roughly as follows:
HttpResponse res = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.UNAUTHORIZED); // Return a 401
channel.writeAndFlush(res).addListener(ChannelFutureListener.CLOSE); // Close the connection
I also don't receive any messages in the OnError method.
The problem now is that I cannot get this 401. In other words, I cannot know that the reason for the connection closing is a verification failure. In this case, I will still try to reconnect.
client version 3.1.1
thanks
The text was updated successfully, but these errors were encountered: