Skip to content

Patch for http to https proxy#102

Open
sukrit007 wants to merge 2 commits intodrewzboto:masterfrom
sukrit007:patch_https-agent
Open

Patch for http to https proxy#102
sukrit007 wants to merge 2 commits intodrewzboto:masterfrom
sukrit007:patch_https-agent

Conversation

@sukrit007
Copy link

Set agent for proxy to address connection refused for proxying request from http to https.

See: https://github.com/nodejitsu/node-http-proxy/blob/caronte/examples/http/proxy-http-to-https.js

It also requires setting of host headers but that can be passed using proxy config.

Purpose of the agent property and PR:
Basically I am running into issue where in if I have http frontend with https proxy backend, I get "Connection Refused". FOr reference here is the issue :
http-party/node-http-proxy#304

To address this issue, we need to do 2 things:

Pass the host header
Pass the agent property

The PR adds the ability to add the agent property to support https proxy to BE host for http front end. In addition it adds the ability to override host header.

@io41
Copy link

io41 commented May 25, 2015

Isn't this covered by PR #101 ? (which also as improved default port handling and fixed usage of the proxy api)

@ruiaraujo
Copy link
Collaborator

I am not really sure the title for this PR is correct.
@sukrit007 What is the goal of that agent property?

@sukrit007
Copy link
Author

@ruiaraujo Looks like there are some conflicts now. I will rebase my changes and squash commits.

Purpose of the agent property and PR:
Basically I am running into issue where in if I have http frontend with https proxy backend, I get "Connection Refused". FOr reference here is the issue :
http-party/node-http-proxy#304

To address this issue, we need to do 2 things:

  • Pass the host header
  • Pass the agent property

I could do first one by passing explicit headers, but could not set the agent property.

@sukrit007
Copy link
Author

@io41 I looked at the PR but did not see agent property. I will rebase my changes and pass the agent property. I need agent property to address http to https proxy (See explanation above)

@sukrit007 sukrit007 force-pushed the patch_https-agent branch from bf42db3 to b6eca26 Compare June 2, 2015 22:43
proxy from http to https

See: https://github.com/nodejitsu/node-http-proxy/blob/caronte/examples/http/proxy-http-to-https.js

It also requires setting of host headers but that can be
passed using proxy config.

Fix typo in test
@sukrit007 sukrit007 force-pushed the patch_https-agent branch from b6eca26 to 390b71a Compare June 2, 2015 22:47
@sukrit007
Copy link
Author

@ruiaraujo : Ready for review

Changes:

  • re-based my changes. ( also squashed commits)
  • resolved merge conflicts
  • Added ability to override host header

@sukrit007
Copy link
Author

Just wanted to followup on this PR. Do you need anything else wrt same ?

@cosmin-dumitrache
Copy link

@ruiaraujo Hi, can you please merge this? I've ran into this issue with my setup as well and this pull request fixed it.

EDIT: Actually, I am seeing an issue. It works when testing with postman, but Chrome and Safari give an error saying the content can not be decoded.

@sukrit007
Copy link
Author

@cosmin-dumitrache working fine on Chrome/Safari. Can you provide exact steps.

Also I will rebase the changes to resolve conflicts. @ruiaraujo: Would you need me to address anything else in this PR ?

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.

4 participants