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

Connection is too slow, needed http proxy support #34

Open
purerosefallen opened this issue Jun 23, 2018 · 3 comments
Open

Connection is too slow, needed http proxy support #34

purerosefallen opened this issue Jun 23, 2018 · 3 comments

Comments

@purerosefallen
Copy link

purerosefallen commented Jun 23, 2018

Our project, https://github.com/moecube/srvpro, attempting to automatically host YGOPro (https://github.com/Fluorohydride/ygopro) tournaments, used your API by this module to automatically seed and seat players into servers and post the score after the match up.
However, I received several complaints from many players that the connection to the server is too slow, and they wish to have a better tourney experience.
During our investigation, we found that it is because of issues of international connections your server that make the connection so slow.
I'm not sure if this is one of those things you could fix. It would be my honor if it is possible for you to add an option which allow me to use an http proxy to connect to your server. It is ok for us to to purchase a better proxy.
Thanks for reading this. We will continue supporting Challonge.

@Tidwell
Copy link
Owner

Tidwell commented Jun 24, 2018

I have a PR open that would allow setting the hostname for the client. See #35. This would allow for something like:

const client = Challonge.createClient({
  apiHostname: 'www.someproxydomain.com'
});

If this would solve this issue, I'll get tests/docs updated, get it merged, and released to npm ASAP.

--

Just to clarify, I'm not affiliated with the actual challonge website. I use their service for one of my projects and wrote this API wrapper as a result. If you need to get in touch with the owners, their feedback forum is here:

http://feedback.challonge.com/forums/44455-feature-requests

@purerosefallen
Copy link
Author

purerosefallen commented Jun 27, 2018

To tell the truth, at last I added api.challonge.com into /etc/hosts, which got my connection problem solved. Thanks anyway.
Well, I looked carefully through the http node module. It really has an option to choose whether to use a proxy or not.
What I really expect is, to add this option to the Challonge.createClient function, just like:
const client = Challonge.createClient({ proxy: <proxy settings in nodejs> });
We would be so glad if you could spend a little time adding this option.
Thanks!

@Tidwell
Copy link
Owner

Tidwell commented Jun 27, 2018

I'm not sure which option you are referring to, can you link me to where that is in the docs?

I believe the native https.request method accepts the same options as the http.request method. I don't see a proxy option in the arguments list:

https://nodejs.org/api/http.html#http_http_request_options_callback

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