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
websocket proxy,if the sever reject the connect with status other than 101,then the proxy req will not emmit an upgrade event,and the connection from client will hong on by the proxy for a long long time!
maybe the proxy should also catch the response event!
The text was updated successfully, but these errors were encountered:
i have use another account name kd128 instead of iamzfj ^_^
recently,i am using https://github.com/Worlize/WebSocket-Node for ws server,
and found this bug!
in WebSocket-Node,before accept an ws request from client,ws server may reject it!
what about
WebSocketRequest.prototype.reject = function(status, reason, extraHeaders) {
if (typeof(status) !== 'number') {
status = 403;
}
var response = "HTTP/1.1 " + status + " " + httpStatusDescriptions[status] + "\r\n" +
"Connection: close\r\n";
if (reason) {
reason = reason.replace(headerSanitizeRegExp, '');
response += "X-WebSocket-Reject-Reason: " + reason + "\r\n";
}
if (extraHeaders) {
for (var key in extraHeaders) {
var sanitizedValue = extraHeaders[key].toString().replace(headerSanitizeRegExp, '');
var sanitizedKey = key.replace(headerSanitizeRegExp, '');
response += (sanitizedKey + ": " + sanitizedValue + "\r\n");
}
}
response += "\r\n";
this.socket.end(response, 'ascii');
this.emit('requestRejected', this);
websocket proxy,if the sever reject the connect with status other than 101,then the proxy req will not emmit an upgrade event,and the connection from client will hong on by the proxy for a long long time!
maybe the proxy should also catch the response event!
The text was updated successfully, but these errors were encountered: