You can not select more than 25 topics 
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long. 
		
		
		
		
		
			
	
	
		
			
	
		
			This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
		 
	
		
		
			
				
				
					
						
						
						
							---
 
						
						
						
							layout: post
 
						
						
						
							title: Tor在服务器上的使用体验
 
						
						
						
							tags: [tor, 网络]
 
						
						
						
							---
 
						
						
						
							
 
						
						
						
							  就像和普通网络一样使用Tor吧<!--more-->     
 
						
						
						
							
 
						
						
						
							# 起因
  
						
						
						
							, ( ) ~~( , , )   当然, , , , , , , , ?  
						
						
						
							
 
						
						
						
							# 探索过程
  
						
						
						
							, , , , ( ) , , ,  
						
						
						
							  那应该怎么做呢? , , , , , , , , , , :  
						
						
						
							```json
  
						
						
						
							{ 
 
						
						
						
							  "log" :  { 
 
						
						
						
							    "loglevel" :  "warning" 
 
						
						
						
							  }, 
 
						
						
						
							  "routing" :  { 
 
						
						
						
							    "domainStrategy" :  "AsIs" , 
 
						
						
						
							    "strategy" :  "rules" , 
 
						
						
						
							    "settings" :  { 
 
						
						
						
							      "rules" :  [ 
 
						
						
						
							        { 
 
						
						
						
							          "type" :  "field" , 
 
						
						
						
							          "domain" :  [ 
 
						
						
						
							            "regexp:\\.onion$" 
 
						
						
						
							          ], 
 
						
						
						
							          "outboundTag" :  "tor" 
 
						
						
						
							        }, 
 
						
						
						
							        { 
 
						
						
						
							          "type" :  "field" , 
 
						
						
						
							          "outboundTag" :  "block" , 
 
						
						
						
							          "protocol" :  [ 
 
						
						
						
							            "bittorrent" 
 
						
						
						
							          ] 
 
						
						
						
							        } 
 
						
						
						
							      ] 
 
						
						
						
							    } 
 
						
						
						
							  }, 
 
						
						
						
							
 
						
						
						
							  "inbounds" :  [ 
 
						
						
						
							    { 
 
						
						
						
							      "sniffing" :  { 
 
						
						
						
							        "enabled" :  true , 
 
						
						
						
							        "destOverride" :  [ 
 
						
						
						
							          "http" , 
 
						
						
						
							          "tls" 
 
						
						
						
							        ] 
 
						
						
						
							      }, 
 
						
						
						
							      "listen" :  "/dev/shm/proxy.sock" , 
 
						
						
						
							      "protocol" :  "vless" , 
 
						
						
						
							      "settings" :  { 
 
						
						
						
							        "udp" :  false , 
 
						
						
						
							        "clients" :  [ 
 
						
						
						
							          { 
 
						
						
						
							            "id" :  "***" , 
 
						
						
						
							            "alterId" :  0 , 
 
						
						
						
							            "flow" :  "" 
 
						
						
						
							          } 
 
						
						
						
							        ], 
 
						
						
						
							        "decryption" :  "none" , 
 
						
						
						
							        "allowTransparent" :  false 
 
						
						
						
							      }, 
 
						
						
						
							      "streamSettings" :  { 
 
						
						
						
							        "network" :  "ws" , 
 
						
						
						
							        "security" :  "none" , 
 
						
						
						
							        "wsSettings" :  { 
 
						
						
						
							          "path" :  "***" , 
 
						
						
						
							          "headers" :  { 
 
						
						
						
							            "Host" :  "***" 
 
						
						
						
							          } 
 
						
						
						
							        } 
 
						
						
						
							      } 
 
						
						
						
							    } 
 
						
						
						
							  ], 
 
						
						
						
							  "outbounds" :  [ 
 
						
						
						
							    { 
 
						
						
						
							      "protocol" :  "freedom" 
 
						
						
						
							    }, 
 
						
						
						
							    { 
 
						
						
						
							      "protocol" :  "socks" , 
 
						
						
						
							      "settings" :  { 
 
						
						
						
							        "servers" :  [ 
 
						
						
						
							          { 
 
						
						
						
							            "address" :  "127.0.0.1" , 
 
						
						
						
							            "port" :  9050 
 
						
						
						
							          } 
 
						
						
						
							        ] 
 
						
						
						
							      }, 
 
						
						
						
							      "tag" :  "tor" 
 
						
						
						
							    }, 
 
						
						
						
							    { 
 
						
						
						
							      "protocol" :  "blackhole" , 
 
						
						
						
							      "tag" :  "block" 
 
						
						
						
							    } 
 
						
						
						
							  ] 
 
						
						
						
							} 
 
						
						
						
							``` 
 
						
						
						
							  顺便我为了避免不小心服务器被封也屏蔽了bt下载( ? ) , , ,  
						
						
						
							  不过需要注意的一点是这个方法**不能匿名**, , , ( ) ,  
						
						
						
							
 
						
						
						
							# 使用Tor进行建站
  
						
						
						
							, , , , , , , , :  
						
						
						
							```
  
						
						
						
							 
						
						
						
							HiddenServicePort 80 unix:/dev/shm/nginx.sock
 
						
						
						
							``` 
 
						
						
						
							  顺便加两句反蜜罐配置:
 
						
						
						
							```
  
						
						
						
							 
						
						
						
							StrictNodes 1
 
						
						
						
							``` 
 
						
						
						
							  nginx的监听也要注意监听/dev/shm/nginx.sock,  
						
						
						
							  其实我本来想让v2ray的连接Tor也通过Unix domain Socket走,  
						
						
						
							
 
						
						
						
							# 感想