mirror of
				https://github.com/ehang-io/nps
				synced 2025-10-30 15:26:58 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			554 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			554 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package conn
 | |
| 
 | |
| type Secret struct {
 | |
| 	Password string
 | |
| 	Conn     *Conn
 | |
| }
 | |
| 
 | |
| func NewSecret(p string, conn *Conn) *Secret {
 | |
| 	return &Secret{
 | |
| 		Password: p,
 | |
| 		Conn:     conn,
 | |
| 	}
 | |
| }
 | |
| 
 | |
| type Link struct {
 | |
| 	ConnType   string //连接类型
 | |
| 	Host       string //目标
 | |
| 	Crypt      bool   //加密
 | |
| 	Compress   bool
 | |
| 	RemoteAddr string
 | |
| }
 | |
| 
 | |
| func NewLink(connType string, host string, crypt bool, compress bool, remoteAddr string) *Link {
 | |
| 	return &Link{
 | |
| 		RemoteAddr: remoteAddr,
 | |
| 		ConnType:   connType,
 | |
| 		Host:       host,
 | |
| 		Crypt:      crypt,
 | |
| 		Compress:   compress,
 | |
| 	}
 | |
| }
 | 
