Bitcoin Forum
May 12, 2024, 01:04:29 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Mining using a proxy  (Read 4434 times)
almbfsek (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
June 16, 2011, 01:43:16 PM
Last edit: June 16, 2011, 06:45:41 PM by almbfsek
 #1

hello guys,

I have an SSH tunnel that I use as a SOCKS proxy for my web browser. I would also like to use it with mining softwares.
is it even possible? I thought since miners use HTTP protocol it should be possible.
if so, which 3rd party application can I use in order to route the miner's connection through the proxy? or may be the miner's code should be modified?

thank you in advance
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
cynikal
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
June 16, 2011, 03:04:34 PM
 #2

if your miner uses something like libcurl, it will respect the http_proxy environment variable, look into the underlying software/libs you're using and research their proxy support
torusJKL
Hero Member
*****
Offline Offline

Activity: 619
Merit: 500


View Profile
June 16, 2011, 03:14:30 PM
 #3

You can tunnel your localhost port to any homepage.
e.g. localhost:8332 --> pool.com:8332

You can even change port numbers in the process (if you use several pools)
e.g. localhost:8555 --> otherpool.com:8332

Then you connect your miner to localhost:8332 instead to the pool's address.

If you find my post useful send some Bitcoin: 167XM1Za8aG9CdbYuHFMpL2kvPsw6uC8da
Bitrated || bitcoin-otc || Moon Bitcoin Faucet
nuclearstar
Newbie
*
Offline Offline

Activity: 18
Merit: 0


View Profile
June 16, 2011, 04:32:02 PM
 #4

for the record my work has a proxy and my miner works fine without having to configure anything extra.
cynikal
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
June 16, 2011, 05:24:45 PM
 #5

You can tunnel your localhost port to any homepage.
e.g. localhost:8332 --> pool.com:8332

You can even change port numbers in the process (if you use several pools)
e.g. localhost:8555 --> otherpool.com:8332

Then you connect your miner to localhost:8332 instead to the pool's address.

have you actually tried this? I have and depending on how the pool's rpc server is configured, it may not return the data if the request it gets doesn't contain the desired host (e.g. Host: localhost as opposed to actual hostname of the pool server).  Again this depends on the config of the pool but i ran into issues trying to do it this way.

If you really want to scale better, run a proxy service like https://github.com/cdhowie/Bitcoin-mining-proxy (this is what i'm using)
almbfsek (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
June 16, 2011, 06:08:42 PM
Last edit: June 16, 2011, 06:44:34 PM by almbfsek
 #6

@cynikal: thank you. http_proxy is what I was looking for. I did "export http_proxy=socks5://127.0.0.1:11334" and it doesn't work because according to this(http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXY) my curl version(7.21.3) doesn't support protocol prefix(socks5://) on the URL. so I did some research but I couldn't find how to specify socks5 with env. variables. do you know how?

thank you
cynikal
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
June 16, 2011, 06:12:35 PM
 #7

@cynikal: thank you http_proxy is what I was looking for. I did "export http_proxy=socks5://127.0.0.1:11334" and it doesn't work because according to this(http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXY) my curl version(7.21.3) doesn't support protocol prefix(socks5://) on the URL. so I did some research but I couldn't find how to specify socks5 with env. variables? do you know how?

thank you

sorry, i use a http proxy myself (i run one on a server remotely and then i ssh tunnel to that proxy directly, rather than use ssh tunnel as a socks proxy).  upgrade your curl version? or staticly compile a local version of newer libcurl and link/include that static lib into your miner ?
almbfsek (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
June 16, 2011, 06:23:45 PM
 #8

upgrading the libcurl is the easiest I guess, thanks!
almbfsek (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
June 16, 2011, 06:43:21 PM
 #9

well modifying the source was easier afterall Smiley

Quote
curl_easy_setopt(curl, CURLOPT_PROXY, "socks://127.0.0.1:11334");
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);

works like a charm...
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!