Ok, example:
Open up a rebol console and type this:
listen: open tcp://:4351
wait listen conn: first listen
Now open up a second rebol console and type:
port: open tcp://127.0.0.1:4351
Back at the first console:
type? conn ;== port!
conn/remote-ip ;== 127.0.0.1
So here is where you examine the remote-ip and decide whether to close
the port or not.
Now, I've used words similar to those used in webserv.r, but here
is the line in the handle-new-connections function I think you need to
change:
if error? try [ request: parse first (conn: first listen) none ] [ close
conn return ]
to:
if error? try [
conn: first listen ; conn is a port!
if conn/remote-ip <> 127.0.0.1 [make error! "Non-local
connection!"]
request: parse first conn none
][close conn return]
I haven't tested it, but that should work.
Anton.
> Hmmmm... Okay, I'm really showing my ignorance here, but I'm pretty
> new to Rebol.
>
> How do I check port/remote-ip?
>
> Thanks.
>
>
> On Wed, 16 Mar 2005 15:48:32 +1100, Anton Rolls
> <[EMAIL PROTECTED]> wrote:
> >
> > Check port/remote-ip, if it is not localhost (127.0.0.1) then
> > immediately close the connection to that port.
> > Otherwise I guess you could use a firewall to prevent machines
> > connecting to start with.
> >
> > Anton.
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.