mirror of https://github.com/XTLS/Xray-core
				
				
				
			VLESS fallbacks: `dest` defaults to "127.0.0.1" -> "localhost" (#4840)
https://github.com/XTLS/Xray-examples/issues/234#issuecomment-3091319391pull/4909/head
							parent
							
								
									10dbeb4335
								
							
						
					
					
						commit
						abd551e9f7
					
				| 
						 | 
				
			
			@ -544,7 +544,7 @@ func (c *REALITYConfig) Build() (proto.Message, error) {
 | 
			
		|||
				}
 | 
			
		||||
			default:
 | 
			
		||||
				if _, err = strconv.Atoi(s); err == nil {
 | 
			
		||||
					s = "127.0.0.1:" + s
 | 
			
		||||
					s = "localhost:" + s
 | 
			
		||||
				}
 | 
			
		||||
				if _, _, err = net.SplitHostPort(s); err == nil {
 | 
			
		||||
					c.Type = "tcp"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -155,7 +155,7 @@ func (c *TrojanServerConfig) Build() (proto.Message, error) {
 | 
			
		|||
				}
 | 
			
		||||
			} else {
 | 
			
		||||
				if _, err := strconv.Atoi(fb.Dest); err == nil {
 | 
			
		||||
					fb.Dest = "127.0.0.1:" + fb.Dest
 | 
			
		||||
					fb.Dest = "localhost:" + fb.Dest
 | 
			
		||||
				}
 | 
			
		||||
				if _, _, err := net.SplitHostPort(fb.Dest); err == nil {
 | 
			
		||||
					fb.Type = "tcp"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -111,7 +111,7 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) {
 | 
			
		|||
				}
 | 
			
		||||
			} else {
 | 
			
		||||
				if _, err := strconv.Atoi(fb.Dest); err == nil {
 | 
			
		||||
					fb.Dest = "127.0.0.1:" + fb.Dest
 | 
			
		||||
					fb.Dest = "localhost:" + fb.Dest
 | 
			
		||||
				}
 | 
			
		||||
				if _, _, err := net.SplitHostPort(fb.Dest); err == nil {
 | 
			
		||||
					fb.Type = "tcp"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -110,7 +110,7 @@ func TestVLessInbound(t *testing.T) {
 | 
			
		|||
						Alpn: "",
 | 
			
		||||
						Path: "",
 | 
			
		||||
						Type: "tcp",
 | 
			
		||||
						Dest: "127.0.0.1:80",
 | 
			
		||||
						Dest: "localhost:80",
 | 
			
		||||
						Xver: 0,
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue