Desperately need some sort of verbose proxy


#1

I’d post on Stack Overflow, but I know it would get closed…

I need some sort of simple proxy server software that can act as a go-between for an API endpoint, so that I can see all traffic outgoing and incoming.

In other words, let’s say I’m using some Meteor or npm packages to send commands to a SOAP (ugh) API endpoint, at https://super-tech.net/lame?wsdl. I’m getting errors back but I need to see the exact XML being sent to the API endpoint. So I’d like to instead put in my Meteor code a SOAP call to http://localhost:9876/lame?wsdl which would dump any incoming requests to the console, and then forward them to https://super-tech.net. Any responses will get channeled through the proxy.

In other words, a sort of sniffer that will let me see the raw traffic. Does such a thing exist?


#2

is it just for testing? ie, not production?

In the windows world there is a thing called fiddler, it injects itself as a proxy and lets you look at all the traffic, very useful for rest/soap debugging


#3

oh, and apparently they have versions for MAC and linux now.


#4

But… looks very “alpha” and lots of special config. Fiddler for windows is pretty much install and go.


#5

Just for testing. I need to see exactly what XML this SOAP client is sending to the server, because it’s failing miserably.


#6

well, fiddler will do the job. It will also inject itself into ssl connections if you add it as a trusted CA. I’ve used it extensively for exactly this kind of thing.


#7

You could use this: https://mitmproxy.org/

I’ve played with it before to try and “hack” high scores in a stupid iPhone game :smile:


#8

Thanks for that! I’m not totally sure how to set this up. I’m using an npm soap package, and there’s no option for proxies. So I just have to specify an API endpoint to connect to. Maybe I can set up mitmproxy so that whatever connection it gets, it will pass to a specific URL.

So my code can make an API call to http://localhost:8080/something but mitmproxy will always pass that traffic to https://api.someservice.net and preserve the querystring and/or POST, request body, etc.


#9

Oh it isn’t the simplest thing to setup, however it is a complete proxy.

All your network traffic would run through the proxy.
Not sure how you need the topology to work but this is how I used it in the past.

My LAN is pretty typical - a couple of PCs and mobile devices connected.
I setup my Macbook as the MITMProxy, installed the certificate on my mobile, and set my mobile wifi interface up to use the Macbook as the proxy server.
Once completed, all my network traffic from my mobile ran through the Macbook and I could intercept view and edit all network traffic, from any application in real time.


#10

Ugh. I’m afraid mitmproxy is beyond me. I don’t know how to set up the certificate, because I’m not running this on a mobile device nor from the browser, but rather invoking my code from the command line on my Mac (node soap.js).

I’ve got mitmproxy running on a virtual Ubuntu server on my Mac.


#11

You don’t actually need the certificate, that is only if you want to use HTTPS without getting a certificate error…

You just need to route all your network traffic through the computer running MITMProxy.

It does sound like way more than you need, but it is pretty cool to play with.
I spent a good few hours getting my head around it and think it is a pretty neat tool to understand.

edit: not sure how you would do it (or if you can do it) if you’re running MITMProxy on a VM, look up if there are any tutorials…


#12

I think I’m done for the day. I’ve spent at least 6 hours trying to figure this out. My calls to a SOAP API (via the npm soap package) are failing, and all I want to do is “spy” on the HTTPS traffic to figure out what XML is being sent.