mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	support socks proxy in peer url and decouple explicit tor/i2p routing
This commit is contained in:
		
							parent
							
								
									769b058004
								
							
						
					
					
						commit
						7756891510
					
				
					 5 changed files with 74 additions and 61 deletions
				
			
		
							
								
								
									
										11
									
								
								yggdrasil.go
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								yggdrasil.go
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -59,8 +59,6 @@ func (n *node) init(cfg *nodeConfig, logger *log.Logger) {
 | 
			
		|||
	}
 | 
			
		||||
	n.core.DEBUG_setIfceExpr(ifceExpr)
 | 
			
		||||
 | 
			
		||||
	n.core.Dialer = yggdrasil.NewDialer(cfg.Net)
 | 
			
		||||
 | 
			
		||||
	logger.Println("Starting interface...")
 | 
			
		||||
	n.core.DEBUG_setupAndStartGlobalTCPInterface(cfg.Listen) // Listen for peers on TCP
 | 
			
		||||
	n.core.DEBUG_setupAndStartGlobalUDPInterface(cfg.Listen) // Also listen on UDP, TODO allow separate configuration for ip/port to listen on each of these
 | 
			
		||||
| 
						 | 
				
			
			@ -74,14 +72,7 @@ func (n *node) init(cfg *nodeConfig, logger *log.Logger) {
 | 
			
		|||
		}
 | 
			
		||||
		for {
 | 
			
		||||
			for _, p := range cfg.Peers {
 | 
			
		||||
				switch {
 | 
			
		||||
				case len(p) >= 4 && p[:4] == "udp:":
 | 
			
		||||
					n.core.DEBUG_maybeSendUDPKeys(p[4:])
 | 
			
		||||
				case len(p) >= 4 && p[:4] == "tcp:":
 | 
			
		||||
					n.core.DEBUG_addTCPConn(p[4:])
 | 
			
		||||
				default:
 | 
			
		||||
					n.core.DEBUG_addTCPConn(p)
 | 
			
		||||
				}
 | 
			
		||||
				n.core.DEBUG_addPeer(p)
 | 
			
		||||
				time.Sleep(time.Second)
 | 
			
		||||
			}
 | 
			
		||||
			time.Sleep(time.Minute)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue