Skip to content

HTTP server adds .on override to sockets but not .appendListener #27199

@Antonius-S

Description

@Antonius-S
  • Version: v10.15.1 but affects master branch, v12 and so on
  • Platform: W7
  • Subsystem: HTTP server

Here HTTP server adds a .on wrapper to a socket. But no other listener methods are wrapped so if we call socket.addListener() or socket.prependListener() we'll get other results than if we called socket.on().

'use strict';

const http = require('http');

const srv = http.createServer();
srv.on('connection', (socket) => {
	console.log(socket.on === socket.addListener);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues or PRs related to the http subsystem.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions