[ Cmii ] [ Octopus ] - project a lot

This commit is contained in:
zeaslity
2024-03-08 17:23:41 +08:00
parent 52c360eb49
commit 5e80d7baad
56 changed files with 1112 additions and 240 deletions

View File

@@ -1,4 +1,4 @@
package socks5
package main
import (
"encoding/hex"
@@ -6,23 +6,28 @@ import (
"log"
"net"
"net/http"
"testing"
"github.com/miekg/dns"
)
func ExampleServer() {
s, err := NewClassicServer("127.0.0.1:1080", "127.0.0.1", "", "", 0, 60)
func TestNewClassicServer(t *testing.T) {
s, err := NewClassicServer(":9997", "0.0.0.0", "", "", 0, 60)
if err != nil {
log.Println(err)
return
}
// You can pass in custom Handler
s.ListenAndServe(nil)
err = s.ListenAndServe(nil)
if err != nil {
log.Println(err)
return
}
// #Output:
}
func ExampleClient_tcp() {
go ExampleServer()
//go TestNewClassicServer()
c, err := NewClient("127.0.0.1:1080", "", "", 0, 60)
if err != nil {
log.Println(err)
@@ -51,7 +56,7 @@ func ExampleClient_tcp() {
}
func ExampleClient_udp() {
go ExampleServer()
//go ExampleServer()
c, err := NewClient("127.0.0.1:1080", "", "", 0, 60)
if err != nil {
log.Println(err)