0

Ok, I have searched around the forums and googled for a solution but no one seems to have the exact same problem as me or at least no one has posted about it that I can find.

So the problem is I can make a request (using request module) on my personal computer to this API (to get data) but when I try make the same request on the companies work laptop WHILST being connected to the company network I am unable too make the same request (getting ECONNREFUSED error) despite the fact that I can navigate to the URL that I am trying to request on my companies work laptop whilst being connected to the company network using a browser.

However, if I disconnect from the companies network and connect to a hotspot/other WiFi I retrieve data using NodeJs request again.

The things I have tried. I have tried using built in HTTPS module and also passing in headers such as different port numbers (URL I am trying to request only works with port 443 it appears) and setting the User-Agent as well. I haven't tried request the data using my personal computer whilst connected to the companies network because I can not.

It seems to me that my company is detecting that I am requesting the data via a script and blocking it and not actually blocking the site itself. (so I cant even call and ask IT to white-list the site because it looks like it isn't being blocked anyways)

Any help will be appreciated. Thanks

  • Check the real URL used for the connection. Protocol, domain and port must strictly match, even some distinct URLs would mean the same address. – Teemu Oct 01 '19 at 09:04
  • I have checked it and it's right. I have also used several(at least 5) other sites to try get data and they all work on my personal computer and work laptop when not connected to company network. Also tried navigating to the chrome network settings and getting the request headers and passing some of those headers into Node. =( Thanks for the reply anyways tho! – Harris Feng Oct 01 '19 at 09:23

1 Answers1

0

You can try Ngrock https://ngrok.com/download

use ngrock http PORT

run you nodejs application and in another shell run ngrock, it will give you a unique public URL, which you can use for request data

ArUn
  • 1,317
  • 2
  • 23
  • 39