1 # Copyright (c) Twisted Matrix Laboratories.
2 # See LICENSE for details.
5 This shows an example of a bare-bones distributed web set up. The "master" and
6 "slave" parts will usually be in different files -- they are here together only
7 for brevity of illustration. In normal usage they would each run in a separate
13 Then visit http://localhost:19988/.
16 from twisted.internet import reactor, protocol
17 from twisted.web import server, distrib, static
18 from twisted.spread import pb
21 site = server.Site(distrib.ResourceSubscription('unix', '.rp'))
22 reactor.listenTCP(19988, site)
25 fact = pb.PBServerFactory(distrib.ResourcePublisher(server.Site(static.File('static'))))
27 reactor.listenUNIX('./.rp', fact)