On Mon, Aug 13, 2012 at 4:06 AM, Steven Wiley <
steven...@gmail.com> wrote:
> Thanks for clarifying that for me Jesse.
>
> So, then is it true that the server of the page the client is on when making
> the connection can be different the one serving the websocket?
> I guess I am used to thinking about a Java applet situation which will not
> allow a connection to a server other than the one that pushed out the
> applet, a limitation which I have run into in the past.
>
> thanks again,
> Steve
>
>
> On Saturday, August 11, 2012 7:09:24 PM UTC-7, Jesse McNelis wrote:
>>
>> On Sun, Aug 12, 2012 at 4:58 AM, Steven Wiley <
steven...@gmail.com> wrote:
>> > Shouldn't the ws.RemoteAddr() return value contain the client url (.105)
>> > and
>> > not the server url (.102), or am I not thinking about this correctly?
>>
>> "RemoteAddr returns the WebSocket location for the connection for
>> client, or the Websocket Origin for server."
>>
http://go.pkgdoc.org/code.google.com/p/go.net/websocket#Conn.RemoteAddr
>>
>> So the ws.RemoteAddr() isn't related to the client's ip address at
>> all, since that information is usually quite irrelevant.
>> It refers to the origin of the page that the client is on when it is
>> making the websocket connection, which is important for figuring out
>> if the connection should be allowed.
>>
>> If you want the client IP address, then you'll want:
>> clientIP := ws.Request().RemoteAddr
>>
>>
>>
>>
>>
>>
>> --
>> =====================
>>
http://jessta.id.au