1
1
var http = require ( 'http' ) ,
2
2
https = require ( 'https' ) ,
3
3
url = require ( 'url' ) ,
4
- httpProxy = require ( './http-proxy/' ) ,
5
- proxy = exports ;
4
+ httpProxy = require ( './http-proxy/' ) ;
5
+
6
+ /**
7
+ * Export the the proxy "Server" as the main export
8
+ */
9
+ module . exports = httpProxy . Server ;
6
10
7
11
/**
8
12
* Creates the proxy server.
@@ -19,23 +23,23 @@ var http = require('http'),
19
23
* @api public
20
24
*/
21
25
22
- proxy . createProxyServer = proxy . createServer = function createProxyServer ( options ) {
26
+ module . exports . createProxyServer = module . exports . createServer = function createProxyServer ( options ) {
23
27
/*
24
28
* `options` is needed and it must have the following layout:
25
- *
26
- * {
27
- * target : <url string to be parsed with the url module>
28
- * forward: <url string to be parsed with the url module>
29
- * agent : <object to be passed to http(s).request>
30
- * ssl : <object to be passed to https.createServer()>
29
+ *
30
+ * {
31
+ * target : <url string to be parsed with the url module>
32
+ * forward: <url string to be parsed with the url module>
33
+ * agent : <object to be passed to http(s).request>
34
+ * ssl : <object to be passed to https.createServer()>
31
35
* ws : <true/false, if you want to proxy websockets>
32
- * xfwd : <true/false, adds x-forward headers>
36
+ * xfwd : <true/false, adds x-forward headers>
33
37
* secure : <true/false, verify SSL certificate>
34
- * }
35
- *
36
- * NOTE: `options.ws` and `options.ssl` are optional.
37
- * `options.target and `options.forward` cannot be
38
- * both missing
38
+ * }
39
+ *
40
+ * NOTE: `options.ws` and `options.ssl` are optional.
41
+ * `options.target and `options.forward` cannot be
42
+ * both missing
39
43
* }
40
44
*/
41
45
0 commit comments