Open ldc2726 opened 6 years ago
Had the same issue. Client is using "websocket"package:
import { w3cwebsocket as W3CWebSocket } from 'websocket';
const client = new W3CWebSocket('ws://localhost:10010/', 'echo-protocol');
client.onerror = function() {
console.log('Connection Error'); // Triggered onerror.
}
am also facing same issue !!!!!
failed: Connection closed before receiving a handshake response
`var express = require('express'); var app = express(); var expressWs = require('express-ws')(app);
app.use(function (req, res, next) { console.log('middleware'); req.testing = 'testing'; return next(); });
app.get('/', function(req, res, next){ console.log('get route', req.testing); res.end(); });
app.ws('/', function(ws, req) { console.log(111111111) ws.on('message', function(msg) { console.log(msg,'11111111'); }); console.log('socket'); });
module.exports = app;
var ws = new WebSocket('ws://localhost:3000/so');
Hello, there's nothing wrong with me using express+express-ws directly, but I've had trouble with express-cli with an address link.I built an so.js in the lie folder. The restApi is not a problem, but ws is not good. Please help us