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

Support for HTTP proxies #162

Open
michael-thayer-vb opened this issue Jul 2, 2018 · 7 comments
Open

Support for HTTP proxies #162

michael-thayer-vb opened this issue Jul 2, 2018 · 7 comments

Comments

@michael-thayer-vb
Copy link

Is supporting HTTP proxies in irc-framework something realistic?

@prawnsalad
Copy link
Member

I'd happily accept a PR for it if it's put in cleanly.

@michael-thayer-vb
Copy link
Author

I'm afraid I would need a little hand-holding for that. I know enough about how HTTP proxies work to find the missing parts, but I would need to know at least where to make changes in irc-framework.

@prawnsalad
Copy link
Member

You would be looking for the net transport. Here's where it uses the Socks proxy, https://github.com/kiwiirc/irc-framework/blob/master/src/transports/net.js#L83

@michael-thayer-vb
Copy link
Author

When I take a look at other projects, the HTTP CONNECT protocol is simple enough that everyone just implements it themselves, so sadly there are no libraries for it. The most annoying bit is parsing the environment, see https://github.com/request/request/blob/master/lib/getProxyFromURI.js. To save time, I would love to re-use that code (unfortunately it needs minor modification to convert the "http" case to "any protocol" and probably drop the https, which we do not need (its only effect is to use different environment variables). Unfortunately it is Apache 2.0, not MIT. I could ask the authors if converting is alright.
And since I have never before done either node.js or JavaScript, what would be the best way to debug my changes? I have worked out how to run a node.js app which I checked out from Git, but not yet how to test changes to a framework.

@michael-thayer-vb
Copy link
Author

In fact, most of the code linked above is "no proxy" variable handling. And it doesn't handle authentication.

@michael-thayer-vb
Copy link
Author

Ah, the authentication is pushed elsewhere. Quite a lot of code there after all for more generic handling than we need. I will try writing something from scratch at the risk of missing out on features I don't use myself. In fact I don't have easy access to a proxy requiring authentication. Would you be able to live with commented out authentication code?

@michael-thayer-vb
Copy link
Author

I assume that the "test" folder in the git sources is the answer to my question about testing.

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

2 participants