RTC Forums
November 24, 2024, 02:59:26 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: How to best block selective IP access (TRtcHttpServer)?  (Read 4170 times)
craigism
RTC Expired
*
Posts: 5


« on: October 12, 2015, 11:48:32 PM »

I have a TRtcHttpServer with a number of TRtcDataProviders.  I can block access with a 403 message in each of the TRtcDataProviders.  Is there a easy way to do it in the TRtcHttpServer's events to make coding easier?  I would like to return a 403 message and then disconnect the client.

Any ideas?

Thanks.

Craig.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: October 13, 2015, 08:30:10 AM »

TRtcDataProvider, TRtcServerModule, TRtcDataServerLink and TRtcDualDataServerLink components have a CheckOrder property, which defines the order of executing OnCheckRequest events across all components connected to the same Server or ServerLink component. Once a component executing the "OnCheckRequest" event calls the "Sender.Accept" method, no other components will receive any events related to that request and the component will be responsible for process it. Using this mechanism, you can attach a new "TRtcDataProvider" component with a low "CheckOrder" value (negative values are allowed) to your Server component to filter requests and close connections from unwanted IP addresses.

PS. Events on the Server component (TRtcHttpServer, TRtcISAPIServer and TRtcMessageServer) will be called last, allowing you to handle requests which have NOT been accepted by any other connected component. As an alternative, you can use a TRtcDataProvider component with a high "CheckOrder" value to handle requests which weren't "accepted" by any other component.

Best Regards,
Danijel Tkalcec
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 16 queries.