4

I am trying to set up a hidden service in tails and it seems that polipo is blocking access to 127.0.0.1:8080 where I am hosting an Apache site. Is there any way to configure polipo to allow access to certain localhost ports?

My assumption is that this port must be accessible on localhost to me so that vidalia can set up a hidden service to point to it.

When I curl http:// localhost:8080 I get this error

504 Connect to 127.0.0.1:8080 failed: General SOCKS server failure
The following error occurred while trying to access
http:// 127.0.0.1:8080
504 Connect to 127.0.0.1:8080 failed: General SOCKS server failure
Generated Sat, 16 Nov 2013 18:11:43 UTC by Polipo on localhost:8118.

1 Answer 1

3

Since Tails runs from a CDROM, as soon as you reboot, all you configuration and web content will be gone. But, you can get it working.

Tails puts some heavy restrictions on outgoing network packets. You'll have to explicitly allow outgoing packets to port 8080 on the loopback device.

# iptables -I OUTPUT -o lo -p tcp --dport 8080 -j ACCEPT

After this, you should be able to connect to your hidden server through tor.

# cat /var/lib/tor/http_service/hostname
a23a7jqil5dkimu2.onion
# curl http://a23a7jqil5dkimu2.onion:8080
<html><body><h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
</body></html>

Tails will put some environment variables in your shell. Curl uses these to send http(s) requests through polipo

root@amnesia:~# env | grep -i proxy
http_proxy=http://127.0.0.1:8118
GIT_PROXY_COMMAND=/usr/local/bin/connect-socks
HTTPS_PROXY=http://127.0.0.1:8118
https_proxy=http://127.0.0.1:8118
HTTP_PROXY=http://127.0.0.1:8118

If you want to connect directly to your webserver, then unset these environment variables.

# unset http_proxy HTTPS_PROXY https_proxy HTTP_PROXY
# curl http://localhost:8080
<html><body><h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
</body></html>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .