WebSocket and RPC at the same time

#1

Hi,

I’d like to send/receive messages via WebSockets and use RPC [via wamp] at the same time.

So I tried to combine two examples; ‘basic/rpc/timeservice’ and ‘websocket/echo’ (by altering transport_factory.protocol). Although it gained WebSockets functionality RPC is broken. Is there any example code for this case ?

(ps: since i couldn’t find much info about this case, i’m wondering is it rare or else wrong to use both on the same port ?)

Thanks,

Ahmet

0 Likes

#2

Hi Ahmet ,

Hi,

I'd like to send/receive messages via WebSockets and use RPC [via wamp]
at the same time.
So I tried to combine two examples; 'basic/rpc/timeservice' and
'websocket/echo' (by altering /transport_factory.protocol/). Although it

Alterting Autobahn internals is not recommended;)

gained WebSockets functionality RPC is broken. Is there any example code
for this case ?

Yes, this is possible in 3 ways:

1) Run both things on different ports under 1 server.

2) Run both things on 1 port under 1 server:

https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/multiproto
https://github.com/tavendo/AutobahnPython/blob/master/examples/twisted/websocket/multiproto/server1.py

3) Run both things on 1 port under 1 server by virtue of Twisted Web resource hierarchies

https://github.com/tavendo/AutobahnPython/blob/master/examples/twisted/websocket/multiproto/server2.py

···

Am 26.05.2014 19:11, schrieb Ahmet Uludağ:

==

In general, I'd recommend either 1) or 3) ..

Hope this helps,
/Tobias

(ps: since i couldn't find much info about this case, i'm wondering is
it rare or else wrong to use both on the same port ?)

Thanks,

Ahmet

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#3

Thank you for your lightning-fast response! I think I’ll go with the third option which seems better for me.

Ahmet

···

On Mon, May 26, 2014 at 8:22 PM, Tobias Oberstein tobias.o...@gmail.com wrote:

Hi Ahmet ,

Am 26.05.2014 19:11, schrieb Ahmet Uludağ:

Hi,

I’d like to send/receive messages via WebSockets and use RPC [via wamp]

at the same time.

So I tried to combine two examples; ‘basic/rpc/timeservice’ and

‘websocket/echo’ (by altering /transport_factory.protocol/). Although it

Alterting Autobahn internals is not recommended;)

gained WebSockets functionality RPC is broken. Is there any example code

for this case ?

Yes, this is possible in 3 ways:

  1. Run both things on different ports under 1 server.

  2. Run both things on 1 port under 1 server:

https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/multiproto

https://github.com/tavendo/AutobahnPython/blob/master/examples/twisted/websocket/multiproto/server1.py

  1. Run both things on 1 port under 1 server by virtue of Twisted Web resource hierarchies

https://github.com/tavendo/AutobahnPython/blob/master/examples/twisted/websocket/multiproto/server2.py

==

In general, I’d recommend either 1) or 3) …

Hope this helps,

/Tobias

(ps: since i couldn’t find much info about this case, i’m wondering is

it rare or else wrong to use both on the same port ?)

Thanks,

Ahmet

You received this message because you are subscribed to the Google

Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send

an email to autobahnws+unsubscribe@googlegroups.com

mailto:autobahnws+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to a topic in the Google Groups “Autobahn” group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/autobahnws/gI_1NLsph_4/unsubscribe.

To unsubscribe from this group and all its topics, send an email to autobahnws+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

0 Likes