Skip to content

Keep-alive broken if target server sends Connection: close #859

@Rush

Description

@Rush

https://github.com/nodejitsu/node-http-proxy/blob/master/lib/http-proxy/passes/web-outgoing.js#L45

Without agent specified:
Browser <-> Proxy - connects with keep-alive
Proxy <-> Target server - connects without keep-alive
If target server sends Connection: close the first keep-alive connection is broken.

Maybe better logic would be to do by default:

proxyRes.headers.connection = 'keep-alive';

Other option is to simply always use the agent with keepAlive: true which was implemented in Node 0.12 - but as I understand, this would be much more resource hungry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions