I'm writing an HTTP server that listens on a unix socket [...] using
unix creds, using net.UnixConn.{Read,Write}MsgUnix on the underlying
connection
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You get the source address of the connection with conn.RemoteAddr().String() and use that as a key to store your contexts in a global map. Then the http handler can use req.RemoteAddr() to look up the context. Of course remember to delete the map entry when the connection is closed so the map doesn't grow without bound.
Creating and destroying Contexts (adding and removing entries in the global map) could be done with the Server.ConnState hook, which gives you access to the underlying net.Conn. See golang.org/pkg/net/http/#ConnState.