Commit 1e3ffc10382e66408b61859dd0697c655ea28c70
1 parent
1c3b82bc
Exists in
master
and in
39 other branches
Adding punjab.tac file
Showing
1 changed file
with
30 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | +# punjab tac file | |
| 2 | +# tac documentation is at the following URL: | |
| 3 | +# http://twistedmatrix.com/documents/current/core/howto/application.html | |
| 4 | +from twisted.web import server, resource, static | |
| 5 | +from twisted.application import service, internet | |
| 6 | + | |
| 7 | +from punjab.httpb import Httpb, HttpbService | |
| 8 | + | |
| 9 | +root = static.File("./html") | |
| 10 | + | |
| 11 | +# uncomment only one of the bosh lines, use_raw does no xml | |
| 12 | +# parsing/serialization but is potentially less reliable | |
| 13 | +#bosh = HttpbService(1, use_raw=True) | |
| 14 | +bosh = HttpbService(1) | |
| 15 | + | |
| 16 | +# You can limit servers with a whitelist. | |
| 17 | +# The whitelist is a list of strings to match domain names. | |
| 18 | +# bosh.white_list = ['jabber.org', 'thetofu.com'] | |
| 19 | +# or a black list | |
| 20 | +# bosh.block_list = ['jabber.org', '.thetofu.com'] | |
| 21 | + | |
| 22 | +root.putChild('http-bind', resource.IResource(bosh)) | |
| 23 | + | |
| 24 | + | |
| 25 | +site = server.Site(root) | |
| 26 | + | |
| 27 | +application = service.Application("punjab") | |
| 28 | +internet.TCPServer(5280, site).setServiceParent(application) | |
| 29 | + | |
| 30 | +# To run this simply to twistd -y punjab.tac | ... | ... |