1

I'm running a local web server written in Go and I can debug traffic going to it from my browser; but, I can't see the http request that it makes to external services.

Do I have to run some particular configuration of the web server in order to get the traffic to appear in fiddler? It is running as a background process.

eduncan911
  • 17,165
  • 13
  • 68
  • 104
Daniel Robinson
  • 13,806
  • 18
  • 64
  • 112
  • added a reference to [GoProxy](https://github.com/elazarl/goproxy) in my answer if you really want to build in proxy connections into your web app. – eduncan911 Apr 09 '16 at 08:32

1 Answers1

2

Short answer: you can't...

...unless your web application is written to open a connection to a Proxy server and route requests through that connection (e.g. connect to a remote proxy, and then send requests through it).

Typically what developers do is just dump the Web Request/Response to a debug file to inspect during development (or to debug on a live server, by enabling it with a flag at runtime).

Fiddler is a "proxy" service/server. When you are using it normally to debug browser requests, your Browser is configured to connect to a Proxy server. That is, it will send all web requests through your fiddler's local server (I think it's localhost:8888 if i remember from my Windows days of using Fiddler) which in turn makes a connection to your local web server that you are debugging.

You can read more about Proxies at Wikipedia.

proxy server

In that picture above, your local web server would be Alice. Meaning, Alice would need to be configured to connect to a proxy server and then make web requests through it.

EDIT:

(for the "I really need this" crowd)

If you really want to modify your web server to send requests through a proxy, there are a few Go packages already written to help you. GoProxy is one such package.

eduncan911
  • 17,165
  • 13
  • 68
  • 104
  • @thurt the answer is correct for what the OP asked. and the answer and link you provided I think is way off. the OP wants to see the requests his service makes outbound to the internet. The answer you linked to talks about setting up a proxy for `go get` commands. Those are two very different things. – eduncan911 Feb 08 '18 at 00:22
  • thanks, you're right about the comment I posted. I removed that comment and here is a better answer https://stackoverflow.com/a/14663620/3072751 -- this does route outbound http traffic to the proxy. the http_proxy convention is discussed here https://superuser.com/questions/944958/are-http-proxy-https-proxy-and-no-proxy-environment-variables-standard – thurt Feb 08 '18 at 14:46