mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-01-12 21:57:15 +08:00
Compare commits
2 Commits
9138964af3
...
8a59648310
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a59648310 | ||
|
|
b6f741306e |
@@ -108,7 +108,7 @@ func (t *Handler) HandleConnection(conn net.Conn, destination net.Destination) {
|
|||||||
inbound := session.Inbound{
|
inbound := session.Inbound{
|
||||||
Name: "tun",
|
Name: "tun",
|
||||||
Tag: t.tag,
|
Tag: t.tag,
|
||||||
CanSpliceCopy: 1,
|
CanSpliceCopy: 3,
|
||||||
Source: net.DestinationFromAddr(conn.RemoteAddr()),
|
Source: net.DestinationFromAddr(conn.RemoteAddr()),
|
||||||
User: &protocol.MemoryUser{
|
User: &protocol.MemoryUser{
|
||||||
Level: t.config.UserLevel,
|
Level: t.config.UserLevel,
|
||||||
@@ -127,7 +127,7 @@ func (t *Handler) HandleConnection(conn net.Conn, destination net.Destination) {
|
|||||||
Status: log.AccessAccepted,
|
Status: log.AccessAccepted,
|
||||||
Reason: "",
|
Reason: "",
|
||||||
})
|
})
|
||||||
errors.LogInfo(ctx, "processing connection from: ", conn.RemoteAddr())
|
errors.LogInfo(ctx, "processing connection from ", conn.RemoteAddr(), " to ", destination)
|
||||||
|
|
||||||
link := &transport.Link{
|
link := &transport.Link{
|
||||||
Reader: &buf.TimeoutWrapperReader{Reader: buf.NewReader(conn)},
|
Reader: &buf.TimeoutWrapperReader{Reader: buf.NewReader(conn)},
|
||||||
@@ -135,10 +135,7 @@ func (t *Handler) HandleConnection(conn net.Conn, destination net.Destination) {
|
|||||||
}
|
}
|
||||||
if err := t.dispatcher.DispatchLink(ctx, destination, link); err != nil {
|
if err := t.dispatcher.DispatchLink(ctx, destination, link); err != nil {
|
||||||
errors.LogError(ctx, errors.New("connection closed").Base(err))
|
errors.LogError(ctx, errors.New("connection closed").Base(err))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
errors.LogInfo(ctx, "connection completed")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Network implements proxy.Inbound
|
// Network implements proxy.Inbound
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ func (u *udpConnectionHandler) HandlePacket(src net.Destination, dst net.Destina
|
|||||||
Status: log.AccessAccepted,
|
Status: log.AccessAccepted,
|
||||||
Reason: "",
|
Reason: "",
|
||||||
})
|
})
|
||||||
|
errors.LogInfo(ctx, "processing connection from ", src, " to ", dst)
|
||||||
link := &transport.Link{
|
link := &transport.Link{
|
||||||
Reader: &buf.TimeoutWrapperReader{Reader: conn.reader},
|
Reader: &buf.TimeoutWrapperReader{Reader: conn.reader},
|
||||||
// reverse source and destination, indicating the packets to write are going in the other
|
// reverse source and destination, indicating the packets to write are going in the other
|
||||||
|
|||||||
Reference in New Issue
Block a user