the (action =='tunnel') is always false since there is no action and nothing is ever equal to 'tunnel'
Expected Behavior
This is what it should be:
wsServer.on('request', function(request) {
var url = urlParse(request.resource, true);
var params = url.query;
if (params['sb-hc-action'] === 'accept') {
createTunnel(request, params.port, params.host);
} else {
request.reject(404);
}
});
Actual Behavior
Expected Behavior
This is what it should be: wsServer.on('request', function(request) { var url = urlParse(request.resource, true); var params = url.query; if (params['sb-hc-action'] === 'accept') { createTunnel(request, params.port, params.host); } else { request.reject(404); } });
Versions