Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy is not working if port is specified #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Proxy is not working if port is specified #9

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Sep 16, 2019

If port is specified, getting the following error
2019-9-16 16:44:27 - error Socket Closed on proxy 127.0.0.1:4321

It seems that if port is specified, it gets into the parsed hostname which cannot be resolved by dns.
The problem is because url.parse returns host WITH the port. The solution is to simply use hostname field

> ph = url.parse(`http://google.com:2222`);
Url {
  protocol: 'http:',
  slashes: true,
  auth: null,
  host: 'google.com:2222',
  port: '2222',
  hostname: 'google.com',
  hash: null,
  search: null,
  query: null,
  pathname: '/',
  path: '/',
  href: 'http://google.com:2222/' }
>

@ghost
Copy link
Author

ghost commented Sep 16, 2019

@erivni

@shlompy
Copy link

shlompy commented Sep 16, 2019

PR can be closed, re-opened #10 under proper account

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant