proxy: added PackerServer interface

This commit is contained in:
nadoo committed 2022-01-16 23:15:18 +08:00
1 parent 253e5008c4
commit cf1a4e3817
11 files changed
+52 -22

No files matched your search

+6 -1
View File
@@ -96,7 +96,12 @@ func (s *SS) ListenAndServeUDP() {
log.F("[ss] listening UDP on %s", s.addr)
lc = s.PacketConn(lc)
s.ServePacket(lc)
}
// ServePacket implementes proxy.PacketServer.
func (s *SS) ServePacket(pc net.PacketConn) {
lc := s.PacketConn(pc)
for {
c := NewPktConn(lc, nil, nil, true)
buf := pool.GetBuffer(proxy.UDPBufSize)