Hi Cal
I modified one of the web-servers on the REBOL site, to write the browser
IPs to the console. A couple of snippets should be enough to get you going.
listen-port: open/lines tcp://:8080 ; port used for web connections
...
http-port: first wait listen-port
request: first http-port
...
send-page: func [data mime] [
insert data rejoin ["HTTP/1.0 200 OK^/Content-type: " mime "^/^/"]
write-io http-port data length? data
print [now http-port/host length? data http-port/port-id]
]
So after we have an active connection in http-port, properties at browser
end are found in http-port object: the browser IP is http-port/host and the
connection IP is in http-port/port-id. You can also do a reverse dns look-up
on the host IP and log the domain-name if desired.
Hope this helps
Larry
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 24, 2000 8:04 PM
Subject: [REBOL] obtaining IP address of incoming connection
> Is there any way to determine the source address of an incoming TCP
> connection in REBOL? I know it can be done in C and Perl, but I haven't
> found a way to get it in REBOL.
>
> I need to identify source addresses so I can add Common Log File support
to
> %webserv.r
>
> TIA,
>
> - Cal Dixon
>
> -><-
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>