in-client web server

Larry Bates larry.bates at websafe.com
Sun Dec 16 19:15:35 EST 2007


David Montgomery wrote:
> Hi,
> 
> I am working on a thick-client application that serves
> a lot of content as locally generated and modified
> web pages.
> 
> I'm beginning to look at serving (and updating, via AJAX)
> these pages from a web server running within the client
> (mostly to provide a more natural and powerful way of
> interacting with the browser control).
> 
> For a first cut I imagine just starting a web server within
> the client and serving the pages from localhost:<someport>.
> 
> I have a couple questions for anyone with experience with
> this sort of architecture:
> 
>  * First, are there any existing open source libraries that
>    exemplify this approach?  I have a vague recollection that
>    TurboGears started out based on a project with this kind
>    of architecture, but I haven't been able to find anything
>    so far.
> 
>  * Second, are there any gotchas you would point out?  In
>    particular I'm wondering if even this localhost connection
>    will be a problem with many users' firewalls.
> 
> In case it matters, the application is being developed in python
> 2.5.x with wxPython 2.8.x, aimed first at a Windows platform,
> but intended to be portable to Linux and Mac ASAP.
> 
> Thanks for any pointers,
> David

If I understand you correctly, I did something like this recently.  I wanted to 
monitor a long running process via web browser.  I used twisted to create 
simplehttpserver and ran the long running process in another process. 
Periodically I would update information in a python dictionary that was visible 
to the httpserver to generate a proper HTML page by merging a template and the 
progress data upon a request from web browser.  Does this sound at all like what 
you are looking for?  No firewall issues and I even tunneled ports securely over 
ssh and it worked flawlessly.

-Larry



More information about the Python-list mailing list