mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2025-01-24 10:18:48 +00:00
29 lines
456 B
Go
29 lines
456 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"net"
|
||
|
"log"
|
||
|
"SpoofDPI/handler"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
log.Println("##### Listening 8080..")
|
||
|
|
||
|
listener, err := net.Listen("tcp", ":8080")
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
for {
|
||
|
connClient, err := listener.Accept()
|
||
|
if err != nil {
|
||
|
log.Println("error accepting connection", err)
|
||
|
continue
|
||
|
}
|
||
|
|
||
|
log.Println("##### New connection", connClient.RemoteAddr())
|
||
|
|
||
|
go handler.HandleClientRequest(connClient)
|
||
|
}
|
||
|
}
|
||
|
|