INDY HTTP サーバーで 119 ポート (またはその他の使用可能なポート) を使用することは完全に有効であるため、開発マシン内の何かにする必要があります。1024 の予約済みポートより下の 80 以外のポートを使用することはお勧めできませんが、それは別のことです。
簡単なテスト、2 つのアプリケーションを作成しました。関連する部分は次のとおりです。
サーバ
dfm
object Form2: TForm2
Caption = 'Server'
object IdHTTPServer1: TIdHTTPServer
Active = True
Bindings = <>
DefaultPort = 119
Left = 56
Top = 40
end
end
クライアント
dfm
object Form3: TForm3
Caption = 'Form3'
object Memo1: TMemo
Left = 16
Top = 8
Width = 185
Height = 89
Lines.Strings = (
'Memo1')
TabOrder = 0
end
object Button1: TButton
Left = 207
Top = 8
Width = 75
Height = 25
Caption = 'Connect'
TabOrder = 1
OnClick = Button1Click
end
object Button2: TButton
Left = 207
Top = 39
Width = 75
Height = 25
Caption = 'Disconnect'
TabOrder = 2
OnClick = Button2Click
end
object IdTCPClient1: TIdTCPClient
OnStatus = IdTCPClient1Status
ConnectTimeout = 0
Host = 'localhost'
IPVersion = Id_IPv4
Port = 119
ReadTimeout = -1
Left = 32
Top = 40
end
end
パス
procedure TForm3.Button1Click(Sender: TObject);
begin
IdTCPClient1.Connect;
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
IdTCPClient1.Disconnect;
end;
procedure TForm3.IdTCPClient1Status(ASender: TObject; const AStatus: TIdStatus;
const AStatusText: string);
begin
Memo1.Lines.Add(AStatusText);
end;
結果:

たとえば、既定の Windows ダイアログを受け入れることによって、ファイアウォール上のトラフィックを許可することを忘れないでください (Windows ファイアウォールを使用している場合)。
