1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-11-23 12:02:58 -05:00

move port out of address

This commit is contained in:
v2ray
2015-12-16 23:53:38 +01:00
parent 4be7cd7908
commit 34a0cb0b70
34 changed files with 194 additions and 172 deletions

View File

@@ -16,6 +16,7 @@ type DokodemoDoor struct {
config Config
accepting bool
address v2net.Address
port v2net.Port
space app.Space
}
@@ -24,6 +25,7 @@ func NewDokodemoDoor(space app.Space, config Config) *DokodemoDoor {
config: config,
space: space,
address: config.Address(),
port: config.Port(),
}
}
@@ -71,7 +73,7 @@ func (this *DokodemoDoor) handleUDPPackets(udpConn *net.UDPConn) {
return
}
packet := v2net.NewPacket(v2net.NewUDPDestination(this.address), buffer, false)
packet := v2net.NewPacket(v2net.UDPDestination(this.address, this.port), buffer, false)
ray := this.space.PacketDispatcher().DispatchToOutbound(packet)
close(ray.InboundInput())
@@ -112,7 +114,7 @@ func (this *DokodemoDoor) AcceptTCPConnections(tcpListener *net.TCPListener) {
func (this *DokodemoDoor) HandleTCPConnection(conn *net.TCPConn) {
defer conn.Close()
packet := v2net.NewPacket(v2net.NewTCPDestination(this.address), nil, true)
packet := v2net.NewPacket(v2net.TCPDestination(this.address, this.port), nil, true)
ray := this.space.PacketDispatcher().DispatchToOutbound(packet)
var inputFinish, outputFinish sync.Mutex