Files
gopeed/cmd/test.go
T
2019-05-27 19:18:28 +08:00

25 lines
736 B
Go

package main
import (
"fmt"
"io"
"net"
)
func main() {
data := [68]byte{0x13, 0x42, 0x69, 0x74, 0x54, 0x6f, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x05, 0x2c, 0x37, 0xb2, 0x23, 0xe3, 0xaf, 0x73, 0xe7, 0xb0, 0xe7, 0xa0, 0x05, 0x03, 0x07, 0xe6, 0x61, 0xcf, 0x94, 0xe7, 0x0d, 0x2d, 0x55, 0x54, 0x33, 0x35, 0x35, 0x53, 0x2d, 0xaf, 0xb0, 0xec, 0xdc, 0xbf, 0xd1, 0x02, 0x93, 0xd6, 0xf4, 0x9b, 0x24}
conn, err := net.Dial("tcp", "58.179.218.77:47474")
if err != nil {
fmt.Println(err)
}
defer conn.Close()
conn.Write(data[:])
var read [68]byte
_, err = io.ReadFull(conn, read[:])
if err != nil {
fmt.Println(err)
}
fmt.Println(read)
}