question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proxy option leads to uncaught exception if passed without protocol

See original GitHub issue

Reproduce 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:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
dilanhagcommented, May 30, 2021

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

1reaction
kudak3commented, Sep 9, 2022

I have just faced a similar issue on a mac with catalina.

TypeError: Cannot read properties of null (reading 'split')
    at required (.../node_modules/requires-port/index.js:13:23)
    at Object.common.setupOutgoing (...../node_modules/http-proxy/lib/http-proxy/common.js:101:7)
    at Array.stream (../node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:127:14)
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found