Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

http-proxy

Package Overview
Dependencies
Maintainers
4
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-proxy - npm Package Compare versions

Comparing version 1.7.3 to 1.8.0

6

lib/http-proxy/passes/web-incoming.js

@@ -148,3 +148,3 @@ var http = require('http'),

for(var i=0; i < web_o.length; i++) {
if(web_o[i](req, res, proxyRes, options)) { break; }
if(web_o[i](req, res, proxyRes, options)) { break; }
}

@@ -154,4 +154,4 @@

proxyRes.on('end', function () {
server.emit('end', req, res, proxyRes);
})
server.emit('end', req, res, proxyRes);
});

@@ -158,0 +158,0 @@ proxyRes.pipe(res);

@@ -99,2 +99,8 @@ var http = require('http'),

proxySocket.on('error', onOutgoingError);
// Allow us to listen when the websocket has completed
proxySocket.on('end', function () {
server.emit('close', proxyRes, proxySocket, proxyHead);
});
// The pipe below will end proxySocket if socket closes cleanly, but not

@@ -116,4 +122,5 @@ // if it errors (eg, vanishes from the net and starts returning

proxySocket.pipe(socket).pipe(proxySocket);
// Make sure server exists before we try to emit
server && server.emit('proxySocket', proxySocket);
server.emit('open', proxySocket);
server.emit('proxySocket', proxySocket); //DEPRECATED.
});

@@ -120,0 +127,0 @@

{
"name" : "http-proxy",
"version" : "1.7.3",
"version" : "1.8.0",

@@ -5,0 +5,0 @@ "repository" : {

@@ -118,5 +118,5 @@ <p align="center">

#### Modify a response from a proxied server
Sometimes when you have recieved a HTML/XML document from the server of origin you would like to modify it before forwarding it on.
Sometimes when you have received a HTML/XML document from the server of origin you would like to modify it before forwarding it on.
[Harmon](https://github.com/No9/harmon) allows you to do this in a streaming style so as to keep the pressure on the proxy to a minimum.
[Harmon](https://github.com/No9/harmon) allows you to do this in a streaming style so as to keep the pressure on the proxy to a minimum.

@@ -199,3 +199,5 @@

* `proxyRes`: This event is emitted if the request to the target got a response.
* `proxySocket`: This event is emitted once the proxy websocket was created and piped into the target websocket.
* `open`: This event is emitted once the proxy websocket was created and piped into the target websocket.
* `close`: This event is emitted once the proxy websocket was closed.
* (DEPRECATED) `proxySocket`: Deprecated in favor of `open`.

@@ -232,8 +234,16 @@ ```js

//
// Listen for the `proxySocket` event on `proxy`.
// Listen for the `open` event on `proxy`.
//
proxy.on('proxySocket', function (proxySocket) {
proxy.on('open', function (proxySocket) {
// listen for messages coming FROM the target here
proxySocket.on('data', hybiParseAndLogMessage);
});
//
// Listen for the `close` event on `proxy`.
//
proxy.on('close', function (req, socket, head) {
// view disconnected websocket connections
console.log('Client disconnected');
});
```

@@ -240,0 +250,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc