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

https #482

Merged
merged 11 commits into from
Sep 21, 2013
Merged

https #482

merged 11 commits into from
Sep 21, 2013

Conversation

srossross
Copy link
Contributor

  • Pushed the options logic for targets and agents to from caronte.createProxyServer to common.setupOutgoing
  • Added headers to options. Can now overwrite headers (see https.js example 2)
  • Added https example. please review the example as I am not sure if this is the intended usage

Also you will notice that the third option raises an error and exits the node interpreter. I am not sure where this error is coming from or where it can be caught.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.62%) when pulling 4ee96dd on srossross:caronte into 69f126b on nodejitsu:caronte.

@yawnt
Copy link
Contributor

yawnt commented Sep 17, 2013

hey, thanks for the PR

i'm okay with the idea of allowing overridable headers, not so much about the agent..

as you might have noticed we disabled it by default and i don't see why would someone want to specify a different agent for each connection (if you can bring a valid usecase i'd be happy to reconsider my position :D )

the philosophy behind caronte is to keep everything as lean and simple as possible.. overloading common.setupOutgoing with features means, ultimately, slowing down proxy.web and proxy.ws .. that's why i don't want to introduce anything new unless critical.. it would also be really good that every modification to caronte's behaviour was coupled with a test case

last thing.. i don't want to sound too picky but i think that keeping a consistent style is important.. please use /* */ for multiline comments and no comma-first.. (i'm in the process of writing a CONTRIBUTING.md, should be available in the next few days)

@srossross
Copy link
Contributor Author

@yawnt thanks for the review. I opened this PR as a discussion. I am happy to follow your CONTRIBUTING.md guidelines and add tests.

As for the use case, my goal was to make the options object consistent between the global caronte.createProxyServer and the per request proxyServer.web|ws calls. What do you think?

Let me know if you think this it is the right direction and I will modify and add tests.

@yawnt
Copy link
Contributor

yawnt commented Sep 17, 2013

i see what you mean.. i think the global options should be used for things that are not subject to changes often..

how about we settle for removing agent from options.target/options.forward.. then we can set the agent in common.setupOutgoing using outgoing.agent = options.agent || false (it should default to false if none is specified).. we should remove the default agent new Agent... and leave that to the user.. that means also taking out maxSock and adjusting documentation/lib/caronte.js

if we do this you can then specify a global Agent and override it locally for free (since extend is used)

about the tests please look at the way lib-common-test.js is setup and follow the same path.. if you have questions, ask ahead

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) when pulling 1b5fb1d on srossross:caronte into 69f126b on nodejitsu:caronte.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) when pulling a350fad on srossross:caronte into 69f126b on nodejitsu:caronte.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 39b0c46 on srossross:caronte into 69f126b on nodejitsu:caronte.

@yawnt
Copy link
Contributor

yawnt commented Sep 18, 2013

when you feel like it's done give me a shout and i will review :) .. lookin good so far.. only thing i'd change is.. in README.md instead of [0] and [1] write the actual links [ my text ]( my link )

@yawnt I think it is good to go. If you have any other tests in mind let me know.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.64%) when pulling 7ad5c0f on srossross:caronte into 69f126b on nodejitsu:caronte.

@srossross
Copy link
Contributor Author

@yawnt let me know what you need to pull this in.

yawnt added a commit that referenced this pull request Sep 21, 2013
@yawnt yawnt merged commit 32dcb04 into http-party:caronte Sep 21, 2013
@yawnt
Copy link
Contributor

yawnt commented Sep 21, 2013

👍 perfect :)

@yawnt
Copy link
Contributor

yawnt commented Sep 21, 2013

argh, i just saw you mentioned me in a commit about this being done.. i don't remember seeing it.. i apologize for the late response :(

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.

3 participants