利open×××自带的http-proxy突破防火墙的封锁

open×××是差很少是你们用来作×××服务器的首先,那open×××如何突破防火墙的封锁咧,有两种解决方案,一是用open×××自带的http-proxy,二是用HttpTunnelnode

1、利open×××自带的http-proxy突破防火墙的封锁
Open×××自己可使用http代理,也就是说,Open×××客户端不是直接和Open×××服务器链接,而是使用http代理进行链接。这个特性是Open×××的外围特性,不是其核心的,然而却能解决不少实际问题,它至关于隧道外面又套了一个隧道,不过这个外面的隧道并非真实的隧道,由于它并无封装,而仅仅是假装了端口信息而已,然而无论怎么说,它仍是使用http代理服务器的connect方法的。具体流程就是:服务器

1.Open×××客户端链接http代理服务器(CONNECT方法);tcp

2.http代理服务器链接Open×××服务器;ide

3.http代理服务器在Open×××客户端和Open×××服务器之间中转数据。ui

Open×××客户端 -->  http代理服务器  -->  Open×××服务器spa

http代理服务器和Open×××服务器可安装在同一台机器上
配置Open×××服务器(安装过程可见之前的博文):代理

cat /etc/open***/server.confserver

  
  
           
  
  
  1. port 9091     
  2. proto tcp   #协议启用tcp  
  3. dev tap  
  4. ca ca.crt  
  5. cert server.crt  
  6. key server.key  
  7. dh dh1024.pem  
  8. server 10.9.0.0 255.255.255.0  
  9. #ifconfig-pool-persist ipp.txt  
  10. client-config-dir /etc/open***/ccd  
  11. push "route 10.9.0.0 255.255.255.0"  
  12. push "redirect-gateway def1 bypass-dhcp"  
  13. push "dhcp-option DNS 8.8.8.8"  
  14. keepalive 10 120  
  15. comp-lzo  
  16. user nobody  
  17. group nobody  
  18. persist-key  
  19. persist-tun  
  20. status status.log  
  21. log open***.log  
  22. verb 3 
 

配置http代理服务器,这里就用squid(安装过程见之前博文)xml

cat /etc/squid/squid.confip

  
  
           
  
  
  1. http_port 8080 #启用通常不会被封的端口  
  2. access_log /var/log/squid/access.log squid  
  3. auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/userpw   #用户名密码认证  
  4. acl password proxy_auth REQUIRED  
  5. http_access allow password  
  6. acl all src 0.0.0.0/0.0.0.0  
  7. http_access allow all  
  8. coredump_dir /var/spool/squid  
  9. header_access Via deny all  
  10. header_access X-Forwarded-For deny all 

Open×××客户端配置:

  
  
           
  
  
  1. client  
  2. dev tap0  
  3. dev-node ***    #tap网卡名称  
  4. proto tcp  
  5. remote 222.101.202.303 9091   
  6. nobind  
  7. persist-key  
  8. persist-tun  
  9. ca ca.crt  
  10. cert client001.crt  
  11. key client001.key  
  12. ns-cert-type server  
  13. comp-lzo  
  14. verb 3  
  15. http-proxy 222.101.202.303 8080 pw.txt  #pw.txt为squid的用户名和密码认证文件,用户名一行,密码一行  
  16. http-proxy-retry 

cat pw.txt
test             #squid认证用户名
test123       #squid认证密码

如今就开始用open×××客户端去链接open×××服务端,若是出现如下的提示信息,就说明经过http-proxy链接open×××服务端成功了

Wed Dec 05 14:24:53 2012 Send to HTTP proxy: 'CONNECT 203.169.243.4:18181 HTTP/1.0' Wed Dec 05 14:24:53 2012 Attempting Basic Proxy-Authorization Wed Dec 05 14:24:55 2012 HTTP proxy returned: 'HTTP/1.0 200 Connection established'

相关文章
相关标签/搜索