github.com/rumpl/bof@v23.0.0-rc.2+incompatible/integration/plugin/volumes/cmd/dummy/main.go (about)

     1  package main
     2  
     3  import (
     4  	"net"
     5  	"net/http"
     6  	"time"
     7  )
     8  
     9  func main() {
    10  	l, err := net.Listen("unix", "/run/docker/plugins/plugin.sock")
    11  	if err != nil {
    12  		panic(err)
    13  	}
    14  
    15  	server := http.Server{
    16  		Addr:              l.Addr().String(),
    17  		Handler:           http.NewServeMux(),
    18  		ReadHeaderTimeout: 2 * time.Second, // This server is not for production code; picked an arbitrary timeout to statisfy gosec (G112: Potential Slowloris Attack)
    19  	}
    20  	server.Serve(l)
    21  }