@@ -41,7 +41,7 @@ An object will be returned with four values:
41
41
Is it then possible to proxy requests by calling these functions
42
42
43
43
``` javascript
44
- require ( ' http' ) .createServer (function (req , res ) {
44
+ http .createServer (function (req , res ) {
45
45
proxy .web (req, res, { target: ' http://mytarget.com:8080' });
46
46
});
47
47
```
@@ -105,7 +105,7 @@ var proxy = httpProxy.createProxyServer({});
105
105
// a web request to the target passed in the options
106
106
// also you can use `proxy.ws()` to proxy a websockets request
107
107
//
108
- var server = require ( ' http' ) .createServer (function (req , res ) {
108
+ var server = http .createServer (function (req , res ) {
109
109
// You can define here your custom logic to handle the request
110
110
// and then proxy the request.
111
111
proxy .web (req, res, { target: ' http://127.0.0.1:5060' });
@@ -140,7 +140,7 @@ proxy.on('proxyReq', function(proxyReq, req, res, options) {
140
140
proxyReq .setHeader (' X-Special-Proxy-Header' , ' foobar' );
141
141
});
142
142
143
- var server = require ( ' http' ) .createServer (function (req , res ) {
143
+ var server = http .createServer (function (req , res ) {
144
144
// You can define here your custom logic to handle the request
145
145
// and then proxy the request.
146
146
proxy .web (req, res, {
0 commit comments