Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
高速公路python握手错误_Python_Twisted_Autobahn_Autobahnws - Fatal编程技术网

高速公路python握手错误

高速公路python握手错误,python,twisted,autobahn,autobahnws,Python,Twisted,Autobahn,Autobahnws,我们正在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/WjD8wdE5cwh

我们正在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))

你能分享你的代码和重现这个问题的步骤吗?我已经发布了我的服务器部分代码,我得到了一个错误,你发布的不是服务器,而是WAMP客户端。你用的是什么WAMP路由器?