Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Port ahmedbodi's changes to parent repo #24

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion distribute_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def quote(arg):
return os.spawnl(os.P_WAIT, sys.executable, *args) == 0

DEFAULT_VERSION = "0.6.28"
DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
DEFAULT_URL = "https://pypi.python.org/packages/source/d/distribute/"
SETUPTOOLS_FAKED_VERSION = "0.6c11"

SETUPTOOLS_PKG_INFO = """\
Expand Down
7 changes: 1 addition & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#!/usr/bin/env python
from distribute_setup import use_setuptools
use_setuptools()

#python setup.py sdist upload

from setuptools import setup
from stratum import version

Expand All @@ -16,5 +11,5 @@
packages=['stratum',],
py_modules=['distribute_setup',],
zip_safe=False,
install_requires=['twisted', 'ecdsa', 'pyopenssl', 'autobahn',]
install_requires=['twisted', 'ecdsa', 'autobahn',]
)
38 changes: 19 additions & 19 deletions stratum/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def setup_finalize(event, application):

import socket_transport
import http_transport
import websocket_transport
#import websocket_transport
import irc

from stratum import settings
Expand Down Expand Up @@ -90,25 +90,25 @@ def setup_finalize(event, application):
https = internet.SSLServer(settings.LISTEN_HTTPS_TRANSPORT, httpsite, contextFactory = sslContext)
https.setServiceParent(application)

if settings.LISTEN_WS_TRANSPORT:
from autobahn.websocket import listenWS
log.msg("Starting WS transport on %d" % settings.LISTEN_WS_TRANSPORT)
ws = websocket_transport.WebsocketTransportFactory(settings.LISTEN_WS_TRANSPORT,
debug=settings.DEBUG,
signing_key=signing_key,
signing_id=settings.SIGNING_ID,
event_handler=ServiceEventHandler)
listenWS(ws)
#if settings.LISTEN_WS_TRANSPORT:
# from autobahn.websocket import listenWS
# log.msg("Starting WS transport on %d" % settings.LISTEN_WS_TRANSPORT)
# ws = websocket_transport.WebsocketTransportFactory(settings.LISTEN_WS_TRANSPORT,
# debug=settings.DEBUG,
# signing_key=signing_key,
# signing_id=settings.SIGNING_ID,
# event_handler=ServiceEventHandler)
# listenWS(ws)

if settings.LISTEN_WSS_TRANSPORT and sslContext:
from autobahn.websocket import listenWS
log.msg("Starting WSS transport on %d" % settings.LISTEN_WSS_TRANSPORT)
wss = websocket_transport.WebsocketTransportFactory(settings.LISTEN_WSS_TRANSPORT, is_secure=True,
debug=settings.DEBUG,
signing_key=signing_key,
signing_id=settings.SIGNING_ID,
event_handler=ServiceEventHandler)
listenWS(wss, contextFactory=sslContext)
#if settings.LISTEN_WSS_TRANSPORT and sslContext:
# from autobahn.websocket import listenWS
# log.msg("Starting WSS transport on %d" % settings.LISTEN_WSS_TRANSPORT)
# wss = websocket_transport.WebsocketTransportFactory(settings.LISTEN_WSS_TRANSPORT, is_secure=True,
# debug=settings.DEBUG,
# signing_key=signing_key,
# signing_id=settings.SIGNING_ID,
# event_handler=ServiceEventHandler)
# listenWS(wss, contextFactory=sslContext)

if settings.IRC_NICK:
reactor.connectTCP(settings.IRC_SERVER, settings.IRC_PORT, irc.IrcLurkerFactory(settings.IRC_ROOM, settings.IRC_NICK, settings.IRC_HOSTNAME))
Expand Down
2 changes: 1 addition & 1 deletion stratum/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION='0.2.13'
VERSION='0.3.14'
4 changes: 2 additions & 2 deletions stratum/websocket_transport.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from autobahn.websocket import WebSocketServerProtocol, WebSocketServerFactory
from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
from protocol import Protocol
from event_handler import GenericEventHandler

Expand Down Expand Up @@ -34,4 +34,4 @@ def __init__(self, port, is_secure=False, debug=False, signing_key=None, signing
WebSocketServerFactory.__init__(self, uri)

# P.S. There's not Websocket client implementation yet
# P.P.S. And it probably won't be for long time...'
# P.P.S. And it probably won't be for long time...'