0

我正在尝试/学习crossbar.ioAutobahn/Python。我可以创建一些小组件来编写文件、运行 shell 命令,现在我正在遵循这个描述。我有config来自Router with Application Sessionin的例子.crossbar/config.json

不幸的是,我得到了这个:

[root@devtest write_file]# /opt/pypy/buildout/venv/bin/crossbar check
Checking local configuration file /opt/crossbar/write_file/.crossbar/config.json

Error: encountered unknown attribute 'processes' in top-level configuration

我不知道如何将示例config与一些工作结合起来config

我会很感激任何帮助。

谢谢。

4

1 回答 1

0

深入研究 Crossbar.io 的配置后我发现,我不能简单地从上述描述中复制粘贴示例配置文件。

经过反复试验,我现在有了一个不错的路由器组件配置:

{
   "controller": {
   },  
   "workers": [
      {   
         "type": "router",
         "options": {
            "pythonpath": [".."]
         },  
         "realms": [
            {   
               "name": "realm1",
               "roles": [
                  {   
                     "name": "anonymous",
                     "permissions": [
                        {   
                           "uri": "*",
                           "publish": true,
                           "subscribe": true,
                           "call": true,
                           "register": true
                        }   
                     ]   
                  }   
               ]   
            }   
         ],  
         "transports": [
            {   
               "type": "web",
               "endpoint": {
                  "type": "tcp",
                  "port": 8080
               },  
               "paths": {
                  "/": {
                     "type": "static",
                     "directory": ".."
                  },  
                  "ws": {
                     "type": "websocket"
                  }   
               }   
            }   
         ],  
         "components": [
            {   
                "type": "class",
                "realm": "realm1",
                "classname": "write_file.write_file.WriteFile"
            }   
         ]   
      }   
   ]   
}

于 2014-09-23T14:02:15.660 回答