0
我已经通过IdHTTP-组件创建一个HTTP server,现在我想通过互联网来访问它。我从文本文件发布了一个字符串。访问本地主机通过互联网
我可以通过它accesss:
但我怎么通过互联网存取权限吗?我试过http://[myexternalIPaddress]:80但我没有得到答复。
这是我的代码:
procedure TForm1.IdHTTPServer1CommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
myFile : TextFile;
text: String;
begin
AssignFile(myFile, 'C:\Users\xxx\Desktop\test.txt');
Reset(myFile);
ReadLn(myFile, text);
AResponseInfo.ContentText := text;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
IdHTTPServer1.Active := True;
end;
你需要的端口转发您的路由器。在路由器中打开端口80(并允许在防火墙中进行连接) – Jer