mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
proxy: added PackerServer interface
This commit is contained in:
1 parent
253e5008c4
commit
cf1a4e3817
11 files changed
+52
-22
No files matched your search
@@ -106,8 +106,13 @@ func (s *Socks5) ListenAndServeUDP() {
|
||||
|
||||
log.F("[socks5] listening UDP on %s", s.addr)
|
||||
|
||||
s.ServePacket(lc)
|
||||
}
|
||||
|
||||
// ServePacket implementes proxy.PacketServer.
|
||||
func (s *Socks5) ServePacket(pc net.PacketConn) {
|
||||
for {
|
||||
c := NewPktConn(lc, nil, nil, true, nil)
|
||||
c := NewPktConn(pc, nil, nil, true, nil)
|
||||
buf := pool.GetBuffer(proxy.UDPBufSize)
|
||||
|
||||
n, srcAddr, err := c.ReadFrom(buf)
|
||||
|
||||
Reference in new issue
Block a user