-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunserver.py
68 lines (63 loc) · 2.88 KB
/
runserver.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# library
from twisted.web.wsgi import WSGIResource
from twisted.web.server import Site
from twisted.internet import reactor, defer, ssl
from twisted.internet.task import deferLater
from twisted.web.server import NOT_DONE_YET
from twisted.web import server, resource
from twisted.python import log
from stompest.async import Stomp
from stompest.async.listener import SubscriptionListener
from stompest.config import StompConfig
from stompest.protocol import StompSpec
import json
import logging
# import fedoraManger2 (fm2) app
from RebSearch import app
sslContext = ssl.DefaultOpenSSLContextFactory(
'inc/ssl/privkey.pem',
'inc/ssl/cacert.pem',
)
# twisted liseners
logging.basicConfig(level=logging.DEBUG)
resource = WSGIResource(reactor, reactor.getThreadPool(), app)
site = Site(resource)
if __name__ == '__main__':
# reactor.listenTCP( 5001, site )
# print "RebSearch searches..."
# reactor.run()
reactor.listenSSL(
5001, # integer port
site, # our site object, see the web howto
contextFactory = sslContext,
)
print "RebSearch searches..."
print '''
-.+:///` `///:+.-
`-s:/ `./+/- -/+/.` /:s-`
`++/s+: `:+/` `/+:` :+s/++`
-o++:ss. .//. .//. .ss:++o-
.+oss:+-+h` `::. .-:` `h+-+:sso+.
smhos.y::h `-:` `:-` h::y.sohms
hdsss`s/-h `---` h-/s`sssdh
dd+s+ oo.s : s.oo /s+dm
.Ny/o+`oo-+ : +-oo`+o/yN.
:Mo+:+.+o/: : :/o+.+:+oM:
+m:+-/-:o+. : .+o--/-+:N+
sd-:-:/.+o : o+./:-::ms
dd:.:.+`:+ : +:`+.:.:dd
ms:./`+../ : /..+`/.:sm
.h/..: /-`:``` : ```:`-/ :..+h.
/m/``: /`.-////-.` : `.-////-.`/ :``/m/
/N- : ----.-:/+so+-` : `-+oso::-.---- - -N/
+d` `:...-://::/oooyo+-` : `-+oyooo/:://:--..:` `d+
sd .:.--::--:/++/+ssydNh/` : `/hNdyss+/++/:--::--.:. ds
`hh-:://:::/+/::///:/oosdNd/` : `/dNdsoo/:///::/+/::://::-hh`
.sh++////+/://+::///::/:/+ohs- : -sho+/:/::///::///:/+////+ohs.
-:+yhyssoo+:::/:-:/-.-:..-.:o/:/o:.-..:-.-/:-:/:::+oossyhyo:-
.-:/syhyso+/-.-.``` `./y/.` ```.-.-/+osyhys/:-.
.-:+syyo+/:.``-smMMMms-``.:/+oyys+:-.
.--+syyysososssyyys+:-.
`` ``
'''
reactor.run()