Skip to content

Fix:server on close on websocket only condition#910

Closed
xen-HendryZheng wants to merge 1 commit into
chimurai:masterfrom
xen-HendryZheng:fix-add-condition-server-on-close-only-for-websocket-option
Closed

Fix:server on close on websocket only condition#910
xen-HendryZheng wants to merge 1 commit into
chimurai:masterfrom
xen-HendryZheng:fix-add-condition-server-on-close-only-for-websocket-option

Conversation

@xen-HendryZheng
Copy link
Copy Markdown

@xen-HendryZheng xen-HendryZheng commented May 1, 2023

Description

Fixes #909

Motivation and Context

How has this been tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.


if (server && !this.serverOnCloseSubscribed) {
// subscribe to http 'close' event to close proxy socket on ws true
if (server && !this.serverOnCloseSubscribed && this.proxyOptions.ws === true) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is incorrect.

proxy server should listen to server close event.

regardless of ws: true being used or not

@chimurai
Copy link
Copy Markdown
Owner

fix is incorrect.

proxy should be configured and used correctly in the server

@chimurai chimurai closed this May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak detected on the EventEmitter with http-proxy-middleware.js where server.on('close') listener is added for non websocket usage

2 participants