To create a HTTP server in Go, you can use the net/http
package. Here's an example:
main.go585 chars29 lines
This will create a server that listens on port 8080 and responds to all requests with the binary data from the request body. The Content-Type
header is set to application/octet-stream
to indicate that the response is binary data.
gistlibby LogSnag