[Twisted-Python] better way to do this?
Glenn Hochberg
gah at research.att.com
Tue May 29 17:24:09 MDT 2007
On May 29, 2007, at 6:24 PM, Eli Criffield wrote:
> What i want to do is validate the "From" host of an xmlrpc server
> against a list of allowed servers.
>
> Sounds easy enough but "connectionMade(self)" Call is way back in
> http.HTTPChannel. That is set as the protocol in http.HTTPFactory and
> HTTPFactory is inherits by server.Site.
>
> So whats the best way to change one little function in
> http.HTTPChannel ?
>
> Here is what i have now, but the I have to include all of server.Site
> in my example, even though its unchanged except it inherits
> myHTTPFactory instead of http.HTTPFactory.
>
> Is there a simpler way to do this?
>
> Eli Criffield
<snip>
This seems like it should work; I tried it with your Example and it
does seem to have the same effect:
class mySite(server.Site):
protocol = myHTTPChannel
Glenn Hochberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20070529/949e0abb/attachment.html>
More information about the Twisted-Python
mailing list