Connecting to localhost redirects through proxy - rest

I am trying to call an endpoint on a locally hosted Tomcat server using Postman. However, when I make the call to:
localhost:9000/api/postMethod
it redirects my request through the corporate proxy.
I don't see any options in Postman and I have tried removing the proxy settings in the internet options, but the problem persists.
When I look at the Postman Console, I see the below. Why is it sending proxy-authorization and proxy-connection to localhost?
Request Headers:
cache-control:"no-cache"
Postman-Token:"{token}"
User-Agent:"PostmanRuntime/3.0.11-hotfix.2"
Accept:"*/*"
accept-encoding:"gzip, deflate"
proxy-authorization:"Basic {auth}"
referer:"http://localhost:9000/api/postMethod"
Response Headers:
cache-control:"no-cache"
connection:"Keep-Alive"
content-length:"8063"
content-type:"text/html; charset=utf-8"
pragma:"no-cache"
proxy-connection:"Keep-Alive"

I had my http_proxy system environment variable set. Looks like it's working once I removed it and restarted Postman.

You must set the following environment variables (I do it in .bashrc file):
$ env | grep PROXY
HTTP_PROXY=myProxy:9999
HTTPS_PROXY=myProxy:9999
NO_PROXY=localhost,127.0.0.1
Then, you have to tell Postman to use the System Proxy in the Proxy settings section. It's just annoying because you can set your proxy in the settings, but you can't set no proxy hosts.

If you're stuck behind a corporate proxy or similar and you're using automatic proxy configuration which won't let you allow to connect to localhost addresses, this is what helped me:
Try using your IP address instead of localhost as a host name in your client application, e.g. http://127.0.0.1/api/v1/...

Related

Sending HTTP via proxy with haproxy

We have a company proxy (ip:port) and need to send HTTP POST with json payload to the URL like "http://server1.smthng.com/foo". Locally, name could not be resolved, but it is resolved at proxy. I dont understand how to configure haproxy to use proxy "ip:port" and send request without modifying the original URL.
I've tried curl to "http://server1.smthng.com/foo" after setting https_proxy variable from CLI (in linux) and it worked for me, so now I need to replicate same via haproxy.
From curl logs I could see that it first makes a CONNECT to proxy and once connection is there it POSTs the data.
I could be missing some knowledge here regarding tcp tunnels and the answer could be simple really. Anyway, need help.
The question is to be closed with no asnwer. The solution we took is via civetweb htt_proxy parameters.

Parse-server SSL IIS

I have tried using serverURL as localhost:1337/parse and publicServerURL as https://mydomaindotcom:1337/parse but I don't know how parse is recognizing the certificate. I don't see a config value to set the cert for parse-server.
Also tried adding cert to IIS 7 to a website on port 443 and using URL Rewrite 2.0 to localhost:1337/parse.
I'm running a self-hosted parse instance using node. parse-server is installed globally. I'm using a config file to start to instance.
Server works fine on http, however I need to utilize https so I can use the rest or js api key without passing headers like so https://myAppID:javascript-key=myJavaScriptKey#mydomaindotcom/classes/GameScore/Ed1nuqPvcm
Any help is much appreciated.
You need to add an https binding that references port 1337 if that is the one that you want to use.

How to use Fiddler in C# with a proxy?

I've been using Fiddler in C#.
So far I'm able to intercept requests. However, I need to set a proxy. I did so, the proxy is set.
In Proxy Settings Windows' form, I have for HTTP and Secure: 127.0.0.1 for Proxy address to use and for the Port, 8888.
This is the same that is done when I use Fiddler application directly.
However, when I set it through my C# code, instead of using Fiddler, I can't navigate. My pages give me the message:
Your connection is not secure
What more do I need to do? What Fiddler do that I'm missing to correctly set a proxy?
Usually if it cant make a secure connection, you need to trust Fiddler's root certificate on your development PC. If you are using Firefox you will have to do an additional step to trust the certificate inside FF.

Apiary Proxy Request Timed Out

I'm trying to use Apiary to document my API and test requests but I keep getting a response 504 Proxy Request Timed Out.
My API is running on my machine under http://localhost:3000/ and I specified that under the HOST metadata.
When I click compare under the call, it shows that Apiary added a header "host" that specifies a user specific proxy.
Is there something I am missing or does Apiary just not like localhosts?
Because the proxy remotely calls your specified HOST, you cannot directly call localhost. You could could use https://ngrok.com and set up a tunnel and use the tunnel URL as the HOST.

Opening Foxx API to local network

I have setup serverend points they work for the web interface fine but the api endpoint for my for app do not even give a error and does not time out.
I have tried turn the app to production mode in the web interfaces no joy.
I look at the doc for server setup but can find any thing to help.
So I would think their is configure issue where should I look?
On localhost ever thing works.
On remote host where using 168.192.0.15:8530 only web interface works not my api form either curl or may app
Without further information I can only guess what the problem is, but I'll try:
The default --server.endpoint configuration value for an ArangoDB server is tcp://127.0.0.1:8529. That means you will be able to access it from the local machine but not from other hosts.
To make the server respond to HTTP requests originated from other hosts, you will need to use an endpoint that includes the server's IP address as used in your network, e.g. tcp://192.168.173.13:8529 and restart it with the adjusted configuration.
If that's not working either, can you trying calling the target URL from another server via curl and check the server's HTTP response code. This might reveal the source of the problem, too. Note that you should invoke curl with the option --dump - to see the HTTP response code. For example:
curl -X GET --dump - http://192.168.173.13:8529/your/app
If that is not producing any results (i.e. no response at all), you might have a firewall in between that blocks requests. Probably you need to allow access on the port ArangoDB uses (8529 by default and used in my example).
So I have learn the issue is the api endpoint url is not the same on localhost at their are from outside. Example:
curl -X GET --dump - http://localhost:8529/broad/broad/login
curl -X GET --dump - http://192.168.0.15:8530/_db/_system/broad/broad/login
https://docs.arangodb.com/cookbook/MakingFoxxAppAccessible.html
This lead me to my answer