利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'

相關文章
相關標籤/搜索