Skip to content

How do I run my echo app on a unix domain socket? #1750

Answered by aldas
iambenkay asked this question in Q&A
Discussion options

You must be logged in to vote

echo.StartServer(s *http.Server) uses your provided http.Server instance to serve echo and that server can listen socket (unix) that you provided as Listerner

	listener, err := net.Listen("unix", "/tmp/echo.sock")
	if err != nil {
		log.Fatal(err)
	}
	
	e := New()
	e.Listener = listener

	server := new(http.Server)
	if err := e.StartServer(server); err != nil {
		log.Fatal(err)
	}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by iambenkay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants