node-challonge icon indicating copy to clipboard operation
node-challonge copied to clipboard

Connection is too slow, needed http proxy support

Open purerosefallen opened this issue 7 years ago • 3 comments

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.

purerosefallen avatar Jun 23 '18 11:06 purerosefallen

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

Tidwell avatar Jun 24 '18 02:06 Tidwell

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!

purerosefallen avatar Jun 27 '18 05:06 purerosefallen

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

Tidwell avatar Jun 27 '18 05:06 Tidwell