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

Getting: Not found because of proxy error: Error: socket hang up #5

Closed
omarmeky opened this issue Jan 29, 2014 · 7 comments
Closed

Comments

@omarmeky
Copy link

No description provided.

@omarmeky
Copy link
Author

i am using https://cors-anywhere.herokuapp.com/ with port 443. I get "Not found because of proxy error: Error: connect ECONNREFUSED" when not using port 443

@Rob--W
Copy link
Owner

Rob--W commented Jan 29, 2014

How to reproduce? curl https://cors-anywhere.herokuapp.com/ gives a succesful response.

@omarmeky
Copy link
Author

https://cors-anywhere.herokuapp.com/api.bufferapp.com/1/profiles.json?access_token=[for security purposes I emailed you this]

I performed a GET request and got: "Not found because of proxy error: Error: connect ECONNREFUSED." Note that I successfully made that request via JSONP.

@Rob--W
Copy link
Owner

Rob--W commented Jan 29, 2014

Reproduced error on the live server.
When I launch a local instance of Cors Anywhere (on localhost:8080, node server.js), the API call completes successfully.
When I create a new Heroku instance, the API call also works as intended.
Did you make an excessive number of API calls to buffer? Perhaps they've (temporarily) blocked my server.

Try out https://cors-anywhere-eu.herokuapp.com/. The source code is identical to cors-anywhere.herokuapp.com, but it's hosted in Europe instead of the US. To try out:

  1. Visit https://robwu.nl/cors-anywhere.html.
  2. Open the JavaScript console and set cors_api_url = 'http://cors-anywhere-eu.herokuapp.com/';
  3. Paste the URL in the textbox at the top and click on GET.

@omarmeky
Copy link
Author

Ok, that does indeed work. When I use the European server in Fiddler, however, I still get the error (Not found because of proxy error: Error: connect ECONNREFUSED). Do you have any idea why this happens?

image

@Rob--W
Copy link
Owner

Rob--W commented Jan 29, 2014

It appears that the Buffer API cannot be accessed over http. Calling the Buffer API without any proxies also results in an error if you use http:

$ curl -vv 'http://api.bufferapp.com/1/profiles.json?access_token=[api key here]' -H 'X-Requested-With: Whatever'
* Hostname was NOT found in DNS cache
* Adding handle: conn: 0x7ca560
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7ca560) send_pipe: 1, recv_pipe: 0
*   Trying 54.225.178.31...
* connect to 54.225.178.31 port 80 failed: Connection refused
* Failed to connect to api.bufferapp.com port 80: Connection refused
* Closing connection 0
curl: (7) Failed to connect to api.bufferapp.com port 80: Connection refused

To solve the problem, don't omit the scheme (https) and use the full URL.

https://cors-anywhere-eu.herokuapp.com/https://api.bufferapp.com/1/profiles.json?access_token=[api key here]

@omarmeky
Copy link
Author

That works! I think they changed something recently since I used to be able to use a proxy without adding the scheme. Nevertheless, I appreciate your help.

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