3

Redhat (Red Hat 4.8.3-9) で python 2.7.5 を使用しており、サーバーの起動中に Autobahn Python で単純な helloworld を実行しようとすると、次のエラーが発生します。

# 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))
4

0 に答える 0