mirror of
https://github.com/fatedier/frp.git
synced 2025-01-23 01:52:09 +00:00
28 lines
344 B
Go
28 lines
344 B
Go
package net
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestA(t *testing.T) {
|
|
l, err := ListenUDP("0.0.0.0", 9000)
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
for {
|
|
c, _ := l.Accept()
|
|
go func() {
|
|
for {
|
|
buf := make([]byte, 1450)
|
|
n, err := c.Read(buf)
|
|
if err != nil {
|
|
fmt.Println(buf[:n])
|
|
}
|
|
|
|
c.Write(buf[:n])
|
|
}
|
|
}()
|
|
}
|
|
}
|