In Windows 10, I can easily intercept traffic of an application using Proxifier and route it to Charles proxy, so that I can inspect and edit the data.

 exe -> Proxifier (Socks proxy to localhost:8889) -> Charles (socks listen localhost:8889)

I now would like to replace Charles with my own Java server.

public void StartListener(int port) throws Exception {
    HttpServer server = HttpServer.create(new InetSocketAddress(8889), 0);
    server.createContext("/MyHandler", new MyHandler());

While this works fine if I turn off Proxifier (or even if it's on) open Chrome and navigate to localhost:8889/MyHandler it does not when the exe tries to connect to ExeWebsite.com:80/MyHandler.

I tried settings up Proxifier either as Socks or Http proxy but nothing.

I also tried to edit the Java server like this, as per specs:

HttpServer.create(new InetSocketAddress("ExeWebsite.com", 80), 0);

The result I see in Proxifier log is:

exe.exe *64 - ExeWebsite.com:80 error : Could not connect through proxy - Proxy server cannot establish a connection with the target, status code 400

Which tool should I use to quickly and painlessly redirect all the traffic to my local server?

  • You can set up your own DNS server with a tool like dnschef and respond to DNS A requests for exewebsite.com with In that way you need not bother with "redirecting" the traffic.
    – 0xec
    Commented Nov 3, 2018 at 6:12


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.