projects:wamp:docs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
projects:wamp:docs [2015/08/12 10:46] – [http publisher] scipioprojects:wamp:docs [2017/05/04 17:45] (current) – [http bridge publisher and callew] scipio
Line 28: Line 28:
 <code> <code>
 pip install crossbar[tls,msgpack,manhole,system] pip install crossbar[tls,msgpack,manhole,system]
 +pip install setproctitle
 +</code>
 +
 +ATTENZIONE con la versione 0.11.1, 
 +commentare la riga 232 di lib/lib/python2.7/site-packages/crossbar/controller/process.py
 +<code>
 +#ep['meta'] = e(None)
 </code> </code>
  
Line 104: Line 111:
 </code> </code>
  
-==== http publisher ===+supervisor config 
 +<code> 
 +[program:wamp] 
 +command=/opt/wamp/lib/bin/crossbar start --cbdir /opt/wamp/.crossbar 
 +user=wamp 
 +autostart=true 
 +</code> 
 + 
 +==== http bridge publisher and caller ===
  
-A post request can emit WAMP **event**+An http POST request can emit WAMP event, or we can call an RPC via http POST.
  
 <code> <code>
Line 118: Line 133:
        "paths": {        "paths": {
           ...           ...
-          "notify": {+          "push": {
              "type": "publisher",              "type": "publisher",
 +             "realm": "realm1",
 +             "role": "anonymous"
 +          },
 +          "call": {
 +             "type": "caller",
              "realm": "realm1",              "realm": "realm1",
              "role": "anonymous"              "role": "anonymous"
           }           }
 +
        }        }
     }     }
Line 128: Line 149:
 </code> </code>
  
-example of post+example of event publish
 <code> <code>
  
 import requests import requests
-requests.post("http://router_ip/notify",+requests.post("http://router_ip/push",
                   json={                   json={
                       'topic': 'great_topic'                       'topic': 'great_topic'
Line 139: Line 160:
 </code> </code>
  
-example of post with curl+example of event post with curl
 <code> <code>
 curl --connect-timeout 3 \ curl --connect-timeout 3 \
Line 148: Line 169:
  
  
 +
 +example of RPC call with curl
 +<code>
 +curl --connect-timeout 3 \
 +     -H "Content-Type: application/json" \
 +     -d '{"procedure": "vr.ztl.permessi.get", "args": ["EC316MP"]}' \
 +     http://127.0.0.1:8081/call
 +
 +</code>
 ==== WSGI app (pyramid) ==== ==== WSGI app (pyramid) ====
  
  • projects/wamp/docs.1439369187.txt.gz
  • Last modified: 2015/08/12 10:46
  • by scipio