Proxy option leads to uncaught exception if passed without protocol
See original GitHub issueReproduce by running:
http-server --proxy google.com
You will get an error link this:
/Users/moritzkneilmann/.config/yarn/global/node_modules/requires-port/index.js:13
protocol = protocol.split(':')[0];
^
TypeError: Cannot read property 'split' of null
at required (/Users/moritzkneilmann/.config/yarn/global/node_modules/requires-port/index.js:13:23)
at Object.common.setupOutgoing (/Users/moritzkneilmann/.config/yarn/global/node_modules/http-proxy/lib/http-proxy/common.js:101:7)
at Array.stream (/Users/moritzkneilmann/.config/yarn/global/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:127:14)
at ProxyServer.<anonymous> (/Users/moritzkneilmann/.config/yarn/global/node_modules/http-proxy/lib/http-proxy/index.js:81:21)
at Array.<anonymous> (/Users/moritzkneilmann/.config/yarn/global/node_modules/http-server/lib/http-server.js:111:13)
at dispatch (/Users/moritzkneilmann/.config/yarn/global/node_modules/union/lib/routing-stream.js:119:21)
at Object.onceWrapper (events.js:273:13)
at module.exports.emit (events.js:182:13)
at /Users/moritzkneilmann/.config/yarn/global/node_modules/union/lib/routing-stream.js:114:23
at Object.exports.(anonymous function) (/Users/moritzkneilmann/.config/yarn/global/node_modules/ecstatic/lib/ecstatic/status-handlers.js:37:5)
This is no issue if --proxy https://google.com
is used.
PS: thanks for this package; it’s an essential tool for testing for me 👍
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:19 (10 by maintainers)
Top Results From Across the Web
Invalid options object. Dev Server has been initialized using ...
Here is a workaround. Delete "proxy": "http://localhost:6000". Install package http-proxy-middleware with command npm install ...
Read more >HTTP-Proxy: Exceptions - WatchGuard Technologies
Traffic that matches HTTP-proxy exceptions is still handled by the HTTP-proxy, but, when a match occurs, some proxy settings are bypassed.
Read more >https-proxy-agent - npm
This module provides an http.Agent implementation that connects to a specified HTTP or HTTPS proxy server, and can be used with the built-in ......
Read more >Add an Exception to Your Proxy Settings - City of St. Louis
Add your exceptions to the No Proxy for field, each separated by a comma. We recommend you add: stlouis-mo.gov; dynamic.stlouis-mo.gov. Adding proxy exceptions...
Read more >Handling Application Errors — Flask Documentation (2.2.x)
By default if your application runs in production mode, and an exception is ... be passed an instance of InternalServerError , not the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What is the solution for this? I tried everything. For me it’s working fine in windows PC. But not in mac. It was working fine earlier. Now it gives the error TypeError: Cannot read property ‘split’ of null. required-port
I have just faced a similar issue on a mac with catalina.