Skip to content

Commit

Permalink
Merge pull request #1100 from websockets/remove/unneeded-events
Browse files Browse the repository at this point in the history
Remove unnecessary events
  • Loading branch information
3rd-Eden authored May 10, 2017
2 parents abd27fe + f83843d commit 61ed4b2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
1 change: 0 additions & 1 deletion lib/WebSocketServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class WebSocketServer extends EventEmitter {
this._ultron.on('error', (err) => this.emit('error', err));
this._ultron.on('upgrade', (req, socket, head) => {
this.handleUpgrade(req, socket, head, (client) => {
this.emit(`connection${req.url}`, client);
this.emit('connection', client);
});
});
Expand Down
14 changes: 0 additions & 14 deletions test/WebSocketServer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,6 @@ describe('WebSocketServer', function () {
});
});

it('emits path specific connection event', function (done) {
const server = http.createServer();

server.listen(++port, () => {
const wss = new WebSocketServer({ server });
const ws = new WebSocket(`ws://localhost:${port}/endpointName`);

wss.on('connection/endpointName', (ws) => {
wss.close();
server.close(done);
});
});
});

it('will not crash when it receives an unhandled opcode', function (done) {
const wss = new WebSocketServer({ port: ++port });

Expand Down

0 comments on commit 61ed4b2

Please sign in to comment.