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 don't work when switch target URL to object #1651

Open
ehatari opened this issue Nov 13, 2023 · 0 comments
Open

Proxy don't work when switch target URL to object #1651

ehatari opened this issue Nov 13, 2023 · 0 comments

Comments

@ehatari
Copy link

ehatari commented Nov 13, 2023

Hi, i have some problem with proxy. I try run https -> http proxy.
If i make this code:

var proxy = httpProxy.createProxyServer({
  target: "https://127.0.0.1:443",
  secure:false
})

This work. I try it to convert object but don't work. This is my code:

const proxy = httpProxy.createProxyServer({
  target:{
    host: '127.0.0.1',
    protocol: 'https',
    port: 443
  },
  secure:false
})

I get error:
Error: connect ECONNREFUSED 127.0.0.1:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 443
}

How I convert Target url like string to object ?

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

No branches or pull requests

1 participant