force an application to use a proxy locally (many transparent proxy programs doesn't work)

1

1

I've searched before and came on some solutions like (this, this, this and this). I've an application (Java based) which I must force it to use a proxy (because its online service is censored in my network). I reach the site online using Tor or Freegate which both are run locally on my laptop. I've to use one of these at (127.0.0.1:8580 HTTPs) or (127.0.0.1:9150 Socks). Additionally I don't have a separate server, or connected computer to redirect my outgoing TCP or UDP to that computer. I want this network: Application->Tor->Internet.

According to recommendations above, I can use a transparent proxy such as proxifier. I setup Tor/freegate proxy in my proxifier and setup a rule to allow Tor/FreeGate to connect the internet directly and redirect all other traffics to use my proxy but I get this error in proxifier:

[12.29 17:47:57] javaw.exe *64 - [::ffff:46.4.84.169]:443 (IPv6) error : Could not connect to proxy 127.0.0.1:9150 - connection attempt failed with error 10061

[12.29 18:22:41] javaw.exe *64 - [::ffff:127.0.0.1]:8580 (IPv6) error : Could not connect through proxy 127.0.0.1:8580 - Proxy server cannot establish a connection with the target, status code 400

Do you have any offer? Is it possible to solve this problem with using another transparent proxy program such as CCProxy or WinGate, ....?

p.s. Another solution might be Squid but since I'm not familiar with it and I'm running on Windows 7/x64 do you offer to go after squid 4 windows? can squid offer different or better mechanism than Proxifier?

more description of my failed solution as @barlop asked: I use Proxifier as an transparent proxy. since my desired proxy is locally set up (localhost:9150 or 8550) it's not possible to easily direct all connection to the desired proxy in Proxifier it is kind of recursive since Tor needs a direct access to internet so I add a rule to except my proxy program (Tor or FreeGate) to use internet directly but all other application should redirect their traffic using Proxifier. However I'm not sure about the role of "localhost" in the rule set showed in the uploaded picture to me it's kind of contradiction but with both of them I couldn't connect my application to use the proxy.

here are the image of Rules and Proxies has been set in Proxifier:

http://i.imgur.com/nXNOLOi.png

http://i.imgur.com/H1PW8yx.png

SdidS

Posted 2013-12-29T14:36:23.223

Reputation: 253

can you state the solutions that didn't work – barlop – 2013-12-29T14:48:40.630

1

I don't think ccproxy is transparent, are you sure ccproxy is transparent? last time I used it it wasn't and it probably still isn't. i see screenshots here which are as I remember and at the link http://www.youngzsoft.net/ccproxy/web-proxy-server.htm it says "you do not need to make any proxy server setting in the browser like IE, Firefox, Chrome etc. It's transparent and anonymous" but that looks like dishonest or stupid wording. It could just mean it sets the browser settings for you, like IE and Chrome use the same windows setting anyway.

– barlop – 2013-12-29T14:51:47.627

in your second link it should suggest to you quite rightly that ccproxy is not a transparent proxy. one of the answers there says "You can use a cascading proxy like CCProxy http://www.youngzsoft.net or a transparent proxy like Proxifier http://proxifier.com/"

– barlop – 2013-12-29T15:02:40.543

@barlop, thanks I've seen somewhere which suggested ccproxy.... I've just tested proxifier and not any other transparent proxy solution. The main post is updated. – SdidS – 2013-12-29T15:11:19.047

What about setting the env vars http_proxy=http://localhost:9150/ and https_proxy=http://localhost:9150/ before running the application? – janos – 2013-12-29T17:18:25.133

@janos which applications have you run into that use that environment variable? (and by the way while if that worked it may be ok with the questioner, if it worked, it's worth noting that that is not transparent 'cos the program would be aware that it is using a proxy). – barlop – 2013-12-29T18:22:12.803

@barlop I only recall now command line programs like svn, git, wget, curl, apt-get. Often it is an undocumented feature that the application in fact looks at these variables. But you're right, this is not a transparent method. – janos – 2013-12-29T18:32:12.843

@janos good list. i'd note that i'm aware with wget it i.e. environment variable of http_proxy and https_proxy is documented but not in the --help but is in man wget http://www.gnu.org/software/wget/manual/wget.html#Wgetrc-Commands also I know in wget you can specify it on the command line. Also, wget and curl both have a config file wgetrc or ...curlrc i'd guess that if an app isn't command line then it almost certainly won't have that. And if it is command line, it'd likely have a setting (yes,documented) either that or something else in its docs. btw curl documents http_proxy too.

– barlop – 2013-12-29T18:44:09.640

@Janos, thanks janos I've tried http_proxy (and https_proxy) enviromental variable before (both user and system level), but unfortunately the application doesn't check this variable. – SdidS – 2013-12-30T07:58:18.820

for the sake of troubleshooting, can you get proxifier working without tor? also, one post mentioned haproxy, i haven't tried it. – barlop – 2013-12-30T20:31:54.797

@barlop, yes, I've tried proxifier before for using VPNs. no problem. – SdidS – 2013-12-31T06:46:24.820

this may help http://www.proxifier.com/documentation/v3/chain.htm

– barlop – 2013-12-31T10:52:55.140

Answers

0

I've solved the problem using a PPTP connection. the server I'm connecting to has required proxy and authentication data. It's works just like a transparent proxy.

SdidS

Posted 2013-12-29T14:36:23.223

Reputation: 253