Initial commit

This commit is contained in:
2025-03-12 02:35:41 +08:00
commit af95c45647
4 changed files with 205 additions and 0 deletions

31
main.go Normal file
View File

@@ -0,0 +1,31 @@
package main
import (
"fmt"
"net"
"os"
"os/signal"
"edgaru089.ink/go/regolith/internal/http"
)
func main() {
listener, err := net.Listen("tcp", ":3128")
if err != nil {
panic(err)
}
sigint_chan := make(chan os.Signal, 1)
signal.Notify(sigint_chan, os.Interrupt)
go func() {
<-sigint_chan
listener.Close()
}()
s := &http.Server{}
err = s.Serve(listener)
if err != nil {
fmt.Println(err)
}
}