Add hex2pcap
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// Command pcap-web-tools serves a web UI with tools for pcap packet captures.
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"log"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"pcap-web-tools/internal/web"
|
||||
)
|
||||
|
||||
func main() {
|
||||
addr := flag.String("addr", "localhost:8080", "listen address")
|
||||
flag.Parse()
|
||||
|
||||
srv, err := web.New()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
httpSrv := &http.Server{
|
||||
Addr: *addr,
|
||||
Handler: srv,
|
||||
ReadHeaderTimeout: 10 * time.Second,
|
||||
}
|
||||
log.Printf("listening on http://%s", *addr)
|
||||
log.Fatal(httpSrv.ListenAndServe())
|
||||
}
|
||||
Reference in New Issue
Block a user