I'm using one of the golang samples to build a WebSocket server. According to the samples the struct Client
access websocket.Conn
here and websocket.Conn
has a Request
method returning *http.Request
.
My idea is to subscribe the user to different channels depending on the subdomain they use to enter the app.
So is it possible to get the full URL the user hit when subscribed to the websocket? Using the sample code I thought ws.Conn.Request().URL.Host
would give me something like ws://channel1.lvh.me:8080/sync
but instead I'm getting the path: "/chat".
Is it possible to get the full URL the user used to connect to the websocket? Thanks in advance.