Re: How to allow only a specific IP to connect to the server?

Giganews Newsgroups
Subject: Re: How to allow only a specific IP to connect to the server?
Posted by:  Remy Lebeau (TeamB) (gambit47.no.spam@no.spam.yahoo.com)
Date: Wed, 21 Jul 2004

"Andrea Raimondi" <rainap…@tin.it> wrote in message
news:23F9991CADA5E240rainap…@tin.it...

> I would like to accept connections only from 127.0.0.1 with my
> Indy HTTP server.

In the OnConnect event, you can check the IP and disconnect the socket if
needed.  For example:

    procedure TForm1.IdHTTPServer1Connect(AThread: TIdPeerThread);
    begin
        if AThread.Connection.Socket.Binding.PeerIP <> '127.0.0.1' then
AThread.Connection.DisconnectSocket;
    end;

Gambit

Replies

In response to

How to allow only a specific IP to connect to the server? posted by Andrea Raimondi on Wed, 21 Jul 2004