You are not logged in.
Pages: 1
I want to restrict connection from local web browsers only, after some research, I found one solution - overwrite
THttpServer.Process()
and check
self.RemoteIp
My question is, it'l be better to handle that in my TMVCApplication-derived class, something like if the client is not 127.0.0.1 nor localhost, redirect to access-not-allowed.html. Is this possible? Thanks.
Update 1:
One more possible solution: Overwrite
TSQLHttpServer.Request()
But I'm not sure is it possible to get the client IP in this method...
Last edited by edwinsn (2015-03-12 05:38:09)
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Yes, overriding the THttpServer.Process method will work for ALL incoming HTTP requests.
Overriding TSQLHttpServer.Request is also possible, and is preferred for any kind of HTTP server implementation.
Ensure that you test for 'localhost', '127.0.0.1' and also '::1' for IP v6.
Offline
Pages: 1