What the need of configuring the url in config.json ?

#1

Hi there,

I’m starting playing with crossbar.io and something bother me:

config.yaml

workers:

  • type: router

realms:

  • name: realm1

roles:

  • name: anonymous

permissions:

  • call: true

publish: true

register: true

subscribe: true

uri: ‘*’

transports:

  • type: web

endpoint:

port: 8080

type: tcp

paths:

/:

directory: …/web

type: static

ws:

type: websocket
# url: ws://127.0.0.1:9001/ws

  • type: websocket

endpoint:

port: 9000

type: tcp

type: unix

path: /tmp/socket1
# url: ws://127.0.0.1:9001/ws

  • type: container

components:

  • type: class

classname: hello.AppSession

realm: realm1

transport:

type: websocket

endpoint:

type: unix

path: /tmp/socket1

host: 127.0.0.1

port: 9000

type: tcp

url: ws://127.0.0.1:9000/ws

options:

pythonpath:

``

In this config file, I’ve switched the endpoint to a unix socket. So I don’t get wath the component’s url field is good for in this configuration

  • I cannot remove the field or I get an “missing mandatory attribute ‘url’ in WebSocket transport item” error (btw this seems to be in contradiction with http://crossbar.io/docs/WebSocket-Transport/ which stated that url has a default value…)

  • If I change url to a dummy value (say “ws://127.0.0.2:9001/foo”) everything still works

  • If I add an url field in transports[1] (the websocket) nothing happened either

  • If I add an url field in transports[0].paths.ws the websocket listen on this address

So my guess is url is only usefull in WebSocket-Transport’s path configuration, but in this case why it is mandatory or possible in some other places ?

0 Likes

#2

Hi,

WebSocket requires a URL .. eg you could have a Crossbar.io Web transport running on a Unix domain socket which exposes WebSocket only on some subpath (not / URL) - so the client needs to provide a URL - for WebSocket transports.

Cheers,
/Tobias

···

Am 06.02.2016 um 11:33 schrieb touilleMan:

Hi there,

I'm starting playing with crossbar.io and something bother me:

*config.yaml*
>
workers:
- type: router
   realms:
   - name: realm1
     roles:
     - name: anonymous
       permissions:
       - call: true
         publish: true
         register: true
         subscribe: true
         uri: '*'
   transports:
   - type: web
     endpoint:
       port: 8080
       type: tcp
     paths:
       /:
         directory: ../web
         type: static
       ws:
         type: websocket
         # url: ws://127.0.0.1:9001/ws
   - type: websocket
     endpoint:
       # port: 9000
       # type: tcp
       type: unix
       path: /tmp/socket1
     # url: ws://127.0.0.1:9001/ws
- type: container
   components:
   - type: class
     classname: hello.AppSession
     realm: realm1
     transport:
       type: websocket
       endpoint:
         type: unix
         path: /tmp/socket1
         # host: 127.0.0.1
         # port: 9000
         # type: tcp
       url: ws://127.0.0.1:9000/ws
   options:
     pythonpath:
     - ..

>

In this config file, I've switched the endpoint to a unix socket. So I
don't get wath the component's *url* field is good for in this configuration
- I cannot remove the field or I get an "missing mandatory attribute
'url' in WebSocket transport item" error (btw this seems to be in
contradiction with http://crossbar.io/docs/WebSocket-Transport/ which
stated that url has a default value...)
- If I change url to a dummy value (say "ws://127.0.0.2:9001/foo")
everything still works
- If I add an *url* field in *transports[1]* (the websocket) nothing
happened either
- If I add an *url* field in *transports[0].paths.ws* the websocket
listen on this address

So my guess is *url* is only usefull in WebSocket-Transport's path
configuration, but in this case why it is mandatory or possible in some
other places ?

--
You received this message because you are subscribed to the Google
Groups "Crossbar" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to crossbario+...@googlegroups.com
<mailto:crossbario+...@googlegroups.com>.
To post to this group, send email to cross...@googlegroups.com
<mailto:cross...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/crossbario/531856f3-2916-4119-aca7-969de476edab%40googlegroups.com
<https://groups.google.com/d/msgid/crossbario/531856f3-2916-4119-aca7-969de476edab%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes