[Twisted-Python] Web Proxy that does something different once a day

Andy Fundinger Andy at NewWorldElectric.com
Tue Sep 18 22:00:01 EDT 2007

I'm not sure if this is the level you need an answer on, but I would put a
dictionary in the proxy keyed by IP address and with a value of the last
time that user was forced to the intranet site.  Check that against the
current time and a 16 hour offset and send a redirect message if it's out of
date.  Hoping someone else chimes in with how to stick a redirect into a
proxy, glancing at the code I'm not sure how to tell you to do that, though
it's clearly possible.

Andy Fundinger

On 9/18/07, Fred Trotter <fred.trotter at gmail.com> wrote:
> Hello,
>          I am new to python and I am potentially interested in writing
> a new protocol with Twisted.  However I wanted to start with a simpler
> problem that I have been working on, so that I can understand better
> how twisted works.
>         A particular client wants to enforce a home page for the first
> internet connection each day. They have a intranet portal that gives
> messages to employees and they want to be sure that each employee, no
> matter how they have their homepage set, will see the messages the
> first time they connect. After the first connection they want the
> proxy to simply forward requests to the internet without filtering.
>         Since I need to understand this issue for my other project
> too, how do I get the python loop do one thing based on a "new day"
> for an IP address and then do something else after that action has
> been completed. Example code that addresses my problem would be great,
> but I would be happy to have links to examples that do this...
> Thanks!!
> --
> Fred Trotter
> http://www.fredtrotter.com
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Blog:  http://channel3b.wordpress.com
Second Life Name:  Ciemaar Flintoff

I am a sig Virus. Please put me in your sig so that I can continue to
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20070918/8d04620a/attachment.htm 

More information about the Twisted-Python mailing list