Ошибка рукопожатия автобана Python

Мы используем Python 2.7.5 на Redhat (Red Hat 4.8.3-9) и пытаемся запустить простой helloworld в Autobahn Python, при запуске сервера мы получаем следующую ошибку:

# python AppSession.py
2016-03-22T19:09:03+0530 failing WebSocket opening handshake ('HTTP Sec-WebSocket-Accept bogus value : expected qXfIBc/WjD8wdE5cwhgu67waHX0= / got qxfibc/wjd8wde5cwhgu67wahx0=')

Ваша помощь будет оценена.

Спасибо

Ниже приведен мой код:

from twisted.internet.defer import inlineCallbacks
from twisted.logger import Logger

from autobahn.twisted.util import sleep
from autobahn.twisted.wamp import ApplicationSession, Application
import datetime
import six
import sys


def __memory_and_swap_usage():
    # some code
    return True


def __memory_usage_load():
    # some code
    return True


def memory_usage_load():
    return __memory_usage_load()

def memory_and_swap_usage():
    return __memory_and_swap_usage()


class AppSession(Application):

    log = Logger()

    @inlineCallbacks
    def onJoin(self, details):

        # REGISTER a procedure for remote calling
        #

        yield self.register(memory_and_swap_usage, 'com.example.today_rpc')
        self.log.info("procedure today_rpc() registered")

        # PUBLISH and CALL every second .. forever
        #
        now = memory_and_swap_usage()
        while True:

            # PUBLISH an event
            #
            yield self.publish('com.example.ondatetimenow', now)
            self.log.info("published to 'ondatetimenow' with timestamp {now}",
                          now=now)
            now = memory_and_swap_usage()

            yield sleep(1)


if __name__ == '__main__':
    app = AppSession()
    app.run(url=u"ws://{0}:{1}".format('0.0.0.0', 8091))

0 ответов

Другие вопросы по тегам