Hot answers tagged

57

I assume its a Linux box, so most likely SELinux is preventing the connection as there is no policy allowing the connection. You should be able to just run # setsebool -P httpd_can_network_connect true and then restart nginx.


54

You usually have a proxy for ftp, http and https; I am seeing there hkp:// as an URL; so it should not be directed via a pure http proxy, hence failing the communication. Use this instead: sudo apt-key adv --keyserver keyserver.ubuntu.com --keyserver-options http-proxy=http://localhost:3128 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886 As for the ...


50

ssh -D 8080 name@myserver.com export http_proxy=socks5://127.0.0.1:8080 https_proxy=socks5://127.0.0.1:8080 youtube-dl "youtube.com/watch?V=3XjwiV-6_CA"


28

Here is how it does it: static int getdestaddr_iptables(int fd, const struct sockaddr_in *client, const struct sockaddr_in *bindaddr, struct sockaddr_in *destaddr) { socklen_t socklen = sizeof(*destaddr); int error; error = getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, destaddr, &socklen); if (error) { ...


21

Let's call the machine that has internet access hasinet and the one that doesn't noinet. If you can make an SSH connection from noinet to hasinet You can do this easily with OpenSSH's built-in SOCKS proxy. This command will set up a SOCKS proxy on noinet listening on port 1080: noinet$ ssh -D 1080 hasinet If you can only make SSH connections to noinet ...


20

Try mitmproxy. mitmproxy is an SSL-capable man-in-the-middle proxy for HTTP. It provides a console interface that allows traffic flows to be inspected and edited on the fly. mitmdump is the command-line version of mitmproxy, with the same functionality but without the user interface. Think tcpdump for HTTP. Features Intercept HTTP requests and responses ...


19

You could do what the browser does, i.e. connect to the proxy, $ telnet proxy-server 3128 and talk to it. If there was no authentication, a simple GET request (followed by two newlines (Enter)) with a full hostname and protocol, e.g. GET http://www.google.com/ HTTP/1.1 should suffice. Since you need authentication, you need to provide your username and ...


17

Youtube-dl doesn't support a SOCKS proxy. There's a feature request for it, with links to a couple of working proposals. Youtube-dl supports HTTP proxies out of the box. To benefit from this support, you'll need to run a proxy on myserver.com. Pretty much any lightweight proxy will do, for example tinyproxy. The proxy only needs to listen to local ...


16

You could try URL-encoding your password. @ should be replaced by %40. Tackling Special Characters in Proxy Passwords on Linux indicates this should work, but looking around other people seem not to get that to work (and I have no way of testing this).


15

From what I understand, setting proxies system-wide via that GUI does three things: Set the corresponding values in the dconf database. Set the values in /etc/environment. Set the values in /etc/apt/apt.conf. 1 and 3 take effect immediately. /etc/environment is parsed on login, so you will need to logout and login for that to take effect. (Note that this ...


14

Netcat is not a specialized HTTP client. Connecting through a proxy server for Netcat thus means creating a TCP connection through the server, which is why it expects a SOCKS or HTTPS proxy with the -x argument, specified by -X: -X proxy_protocol Requests that nc should use the specified protocol when talking to the proxy server. ...


14

Wow, thanks for asking this question. I find it rare to see someone fully exploiting SSH and this question hits on a couple of areas. This is not a ProxyCommand issue. The ProxyCommand simply instructs the local ssh client to do something in preparation before trying to talk to the remote client. Yes, in our instance, we talk to another ssh session, but ...


13

If the ssh on the proxy side is new enough (>= OpenSSH 5.4), you can use its -W option which works similar than nc. Add to the corresponding entry in your .ssh/config file: ProxyCommand ssh -W %h:%p PROXYHOST Example: Host TARGETHOST ProxyCommand ssh -W %h:%p PROXYHOST HostName 10.0.0.1


13

ssh writes that particular message as a log message at the info level. Log messages are written to standard error by default. Ssh has options to control what is logged. The configuration setting LogLevel sets the log level. Setting the level to QUIET, FATAL, or ERROR would disable the particular message which you're asking about. You can set LogLevel ...


12

SOCKS5 is just a transport protocol on top of TCP/UDP but below application layer. Thus it's comparable with TCP and UDP, too. There's no inherent encryption in SOCKS, but you application has to care about this (it's not a VPN technology, but a proxy at last). If you want encryption, the protocol you speak inside of the SOCKS-channel has to provide it.


11

You'll need to install and configure an actual SOCKS server on the server, such as Dante, SS5, Delegate or Srelay.


11

Its not your local box which is caching the DNS requests but it is the DNS resolver which you are using in your /etc/resolv.conf who is caching. To prevent to get those cached queries reply: Change the resolver. $ dig @<resolve-ip> www.google.com Flush the DNS cache on the resolver, if you can access the DNS server. $ sudo /etc/init.d/bind restart


11

Not necessary to use http_proxy, try this: curl -x PROXY-SERVER:PORT -U USER:PASS URL curl -x 127.0.0.1:8123 -U XXXXX:Pass "http://example.com/blub/bla.bin"


11

As mentioned previously this is not really load balancing, but it's possible. Try something like: frontend http-in bind *:80 # urls acl host_foo hdr(host) -i www.foo.com acl host_bar hdr(host) -i www.bar.com acl host_zoo hdr(host) -i www.zoo.com # clusters use_backend foo_cluster if host_foo use_backend bar_cluster if ...


10

The performance problem arise when you are tunneling TCP over TCP because you have two layers doing adaptive corrections (slow start, congestion avoidance, fast restransmit see RFC2001). Not bieng aware of one another they will experience great difficulties if you have loss on the outer connection. This page describes the phenomenon in detail. edit: ...


10

It sounds to me like you need a socks client, or a ssh client that understand socks. -D is for ssh to be a socks server/proxy. You could use ssh under tsocks, or another SOCKS wrapper. Or use ssh's ProxyCommand in conjunction with socat or nc -X: ssh -o ProxyCommand='socat - socks:B:%h:21,socksport=1080' C To have a HTTP proxy that uses the SOCKS server ...


9

You can use Proxychains for this. First install proxychains, using the command: $ apt-get install proxychains Then configure your proxy settings in /etc/proxychains.conf file. Add at last, these lines for HTTP and HTTPS proxy. http proxy-ip proxy-port username password https proxy-ip proxy-port username password Now you can ...


9

If using ProxyCommand, you must use something like /usr/bin/nc to connect the server. For invoking your command before connect, you need to use sh -c "command list" to merge the two commands as one. Host remote.machine ProxyCommand sh -c "local_command; /usr/bin/nc %h %p" MORE: If your local_command is too complicated, you can use a script: cat ...


9

Try to run it via ssh socks proxy: echo 'Acquire::socks::proxy "socks://localhost:3128/";' | sudo tee -a /etc/apt/apt.conf ssh -CND localhost:3128 user@remote.host in another terminal session: sudo apt-get whatever you need


9

I would advise to use a solid proxying tool for all (or most) of your proxy needs. $ proxychains4 yaourt -S application proxychains-ng works well - but be sure to configure proxychains.conf before using.


8

Both Perl and Python (and probably Ruby as well) have simple kits that you can use to quickly build simple HTTP proxies. In Perl, use HTTP::Proxy. Here's the 3-line example from the documentation. Add filters to filter, log or rewrite requests or responses; see the documentation for examples. use HTTP::Proxy; my $proxy = HTTP::Proxy->new( port => ...


8

cntlm provides a solution, along with some configuration. The basic steps to follow are: Install cntlm. Edit its configuration file at /etc/cntlm.conf, the comments included makes it easy enough. Add a proxy server (or two). Specify your user name and NT domain name in the appropriate places, and remove the password entry. Start the cntlm service, eg via ...


8

First, you need tun2socks (often a part of the 'badvpn' package). tun2socks sets up a virtual interface which you can route traffic through, and that traffic will get sent through the target socks proxy. Setting it up gets a little tricky as you only want to route certain traffic through the tunnel. This script should do what you want: #!/bin/bash ...


8

There are various solutions for this: 1. Configuring http_proxy variables You can set $http_proxy and other such variables. Most applications will pick this variable automatically. To set it system-wide, you can set this variable in either your ~/.bashrc file or /etc/profile. Set it as: http_proxy=http://user:password@proxyserver.com:3128 https_proxy=...


8

sudo sets up only a limited environment and you might for instance miss the http_proxy env variable that gets initiated by your login shell. You might try to run sudo with the -i option as that will simulate a login session which might load a more complete environment that includes proxy settings or modify /etc/sudoers to stop suppressing the proxy ...


Only top voted, non community-wiki answers of a minimum length are eligible