mirror of
https://github.com/asmogo/nws.git
synced 2025-01-18 18:11:33 +00:00
removed test package
This commit is contained in:
parent
03d756706a
commit
296ac61244
@ -1,49 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"golang.org/x/net/proxy"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// set up a socks5 dialer
|
||||
dialer, err := proxy.SOCKS5("tcp", "localhost:8882", nil, proxy.Direct)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "can't connect to the proxy:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
// use the dialer to connect to the server
|
||||
conn, err := dialer.Dial("tcp", "nprofile1qqs9ntc52tn0app0w7azwpj4s39lnz8h0frnzlhf6mun2ptq9ay36kspzemhxue69uhhyetvv9ujuwpnxvejuumsv93k20v2pva:3338")
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "can't connect to the server:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
counter := int32(0)
|
||||
|
||||
for {
|
||||
|
||||
// Increment the counter
|
||||
counter++
|
||||
|
||||
// Write the counter to the connection
|
||||
err = binary.Write(conn, binary.BigEndian, counter)
|
||||
if err != nil {
|
||||
fmt.Println("Error writing to connection:", err)
|
||||
break
|
||||
}
|
||||
|
||||
// Read the response from the server
|
||||
var response int32
|
||||
err = binary.Read(conn, binary.BigEndian, &response)
|
||||
if err != nil {
|
||||
fmt.Println("Error reading from connection:", err)
|
||||
break
|
||||
}
|
||||
|
||||
fmt.Println("Sent:", counter, "Received:", response)
|
||||
|
||||
}
|
||||
_ = conn.Close()
|
||||
}
|
Loading…
Reference in New Issue
Block a user