When I connected to socket, an error occurred, with the error message "Websocket Failed With Error Error Domain=SRWebSocketErrorDomain Code=2133 "Invalid Sec-WebSocket-Accept response." UserInfo={NSLocalizedDescription=Invalid Sec-WebSocket-Accept response.}".
My Code is :
NSURL * url = [NSURL URLWithString:@“ws://enochmsg.enoch-car.com/ws/enochmsg/chat”];
NSMutableURLRequest * mutableRequset = [NSMutableURLRequest requestWithURL:url];
[mutableRequset addValue:ssoUserId forHTTPHeaderField:@"SSO_USER_ID"];
NSURLRequest * requset = [mutableRequset copy];
self.webSocket = [[SRWebSocket alloc] initWithURLRequest:requset];
self.webSocket.delegate = self;
dispatch_async(dispatch_get_main_queue(), ^{
[strongSelf.webSocket open];
});
Has anyone encountered this situation?
Please help me and thanks!!