查看文章 |
HTun 允许你把数据封装在HTTP/1.1 或者HTTP/1.0协议中再通过一个 HTTP proxy 的80端口出去,建立两台机器之间建立IP VPN连接,通过这样的办法,可以成功避免防火墙的封锁。 这个软件是对于内部网络只开通了http代理来访问外部网络(比如squid),或者内部网络对网络监管得特别严,只允许标准的http数据出去,而你又想连到外网玩CS、QQ游戏、上QQ时的穿透利器。虽然一些vpn软件也支持http代理,比如openvpn也支持http代理,但是它必须使用http代理的connect功能,很多http代理服务器就没有开通connect功能,所以openvpn在这样的网络环境下是不能连接到外部网络中的。HTun使用了标准的http中的post/get,可以成功穿透防火墙! 以上为原理示意图 HTun 建立通过一个合法的HTTP请求的数据传送来建立两台机器之间的点对点连接。HTun服务器放置在外部的Internet 网络中,它监听在80端口接受HTun客户端的连接请求。HTun客户端运行在一个内部网络中,它通过http代理连接到HTun服务器。 HTun只能在linux下运行,使用HTun,必须要求外网有一台HTun服务器正常工作,下面为安装和设置的方法: 1、你的linux内核必须支持tun,加载tun驱动。 2、下载htun的源码,解压、编译、安装 wget http://htun.runslinux.net/dist/htun-0.9.6.tar.gz #>tar -xvzf htun-0.9.6.tar.gz #>cd htun-0.9.6/src #>cp htund /usr/local/bin 以下为网络示意图: ![]() 下面为htun服务器的配置文件:
shashank@zidler:# cat /etc/htund.conf
options { daemonize no logfile /var/log/htund.log tunfile /dev/net/tun debug yes } server { iprange 192.168.254.0/24 server_port 8888 #both server_port and secondary_port must be specified. secondary_port 8889 #Make sure u have given access to these ports in squid. max_clients 10 redirect_host mia.ece.uic.edu redirect_port 80 max_pending 40 idle_disconnect 1800 clidata_timeout 20 min_nack_delay 150 packet_count_threshold 10 packet_max_interval 10 max_response_delay 200 } -------------------------------------------- shashank@mia:#> cat /etc/htund.conf options { daemonize no logfile /var/log/htund.log tunfile /dev/net/tun debug yes } client { do_routing no protocol 2 proxy_ip 131.193.50.187 #Ip address of spiff proxy_port 3128 #Default port for squid # Only uncomment proxy_user and proxy_pass if you need to authenticate with # the proxy. Having them set unnecessarily creates extra HTTP overhead. # proxy_user joeblow # proxy_pass SuperSecret123 server_ip 131.193.50.184 server_port 8888 secondary_server_port 8889 if_name eth0 iprange 192.168.254.0/24 connect_tries 2 reconnect_tries 4 reconnect_sleep_sec 30 channel_2_idle_allow 30 min_poll_interval_msec 200 max_poll_interval 30 poll_backoff_rate 3 ack_wait 10 }
|
