Autbahn.ws + Google Protobuf

#1

Hi,

I’d like to use Autobahn.ws in combination with Google Protobufs. Actually I’m a Java Developer and my Server Infrastructure is already up and running with Netty 4.0.0 CR1 + Protobufs 2.5.0.

When using “standard” Messages over the WebSockets Channel everything is fine, but when using Protobufs, I do have an encoding/decoding problem, as I’m using HTTP but Googles Protobufs.

On the Java Server I do have Classes, such as ProtobufVarint32FrameDecoder, ProtobufDecoder, ProtobufVarint32LengthFieldPrepender and ProtobufEncoder that help me to do the Jobs with Netty. So I was wondering if there a similar thing for Python as well? I’m new to Pyhton so I might have missed something.

Here is the example that works fine in java: https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/worldclock/WorldClockServerInitializer.java

Many Thanks in Advance and looking forward to your response

Kind Regards, Gerald

0 Likes

#2

Hi,

I'd like to use Autobahn.ws in combination with Google Protobufs.

Which? AutobahnPython, AutobahnAndroid, ..?

Actually I'm a Java Developer and my Server Infrastructure is already up
and running with Netty 4.0.0 CR1 + Protobufs 2.5.0.

When using "standard" Messages over the WebSockets Channel everything is
fine, but when using Protobufs, I do have an encoding/decoding problem,
as I'm using HTTP but Googles Protobufs.

On the Java Server I do have Classes, such as
ProtobufVarint32FrameDecoder, ProtobufDecoder,
ProtobufVarint32LengthFieldPrepender and ProtobufEncoder that help me to
do the Jobs with Netty. So I was wondering if there a similar thing for
Python as well? I'm new to Pyhton so I might have missed something.

Protobuf's seem to be supported on Python
https://developers.google.com/protocol-buffers/docs/pythontutorial

Here is the example that works fine in java:
https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/worldclock/WorldClockServerInitializer.java

Many Thanks in Advance and looking forward to your response

Honestly, I'm not sure I understand how this is related to Autobahn. Do you want to write a WebSocket-based client using Protobufs talking to your Netty server? You want a Python or Android client? If so, then yes, you can take AutobahnPython or AutobahnAndroid as a basis, use the raw WebSocket layer those libraries expose, and then layer your Protobuf stuff on top ..

Apart from that, Autobahn also provides WAMP: http://www.wamp.ws/

Different from Protobufs, the serialization is (deliberately) schemaless, and WAMP provides RPC and PubSub messaging patterns.

Tobias

···

Am 11.05.2013 22:19, schrieb Gerald Madlmayr:

Kind Regards, Gerald

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

0 Likes

#3

Hi Tobias,

thanks for point that out to me. After a nice day with afternoon with Wireshark, I was able to overcome the issue. As you pointed out correctly, I don’t need Websockets at all – pure TCP-Sockets will do. Thus I modified the simpleClient from Twisted (http://twistedmatrix.com/documents/12.2.0/core/examples/simpleclient.py) and added some protobuf Encoding using varint (http://code.google.com/p/spinn3r-client/source/browse/src/python/varint.py) and it does the job. No autobahn.ws this time - but I fixed the issues. Thanks for the support.

best, Gerald

···

Am Samstag, 11. Mai 2013 22:19:41 UTC+2 schrieb Gerald Madlmayr:

Hi,

I’d like to use Autobahn.ws in combination with Google Protobufs. Actually I’m a Java Developer and my Server Infrastructure is already up and running with Netty 4.0.0 CR1 + Protobufs 2.5.0.

When using “standard” Messages over the WebSockets Channel everything is fine, but when using Protobufs, I do have an encoding/decoding problem, as I’m using HTTP but Googles Protobufs.

On the Java Server I do have Classes, such as ProtobufVarint32FrameDecoder, ProtobufDecoder, ProtobufVarint32LengthFieldPrepender and ProtobufEncoder that help me to do the Jobs with Netty. So I was wondering if there a similar thing for Python as well? I’m new to Pyhton so I might have missed something.

Here is the example that works fine in java: https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/worldclock/WorldClockServerInitializer.java

Many Thanks in Advance and looking forward to your response

Kind Regards, Gerald

0 Likes

#4

Hi Tobias,

thanks for point that out to me. After a nice day with afternoon with
Wireshark, I was able to overcome the issue. As you pointed out
correctly, I don't need Websockets at all -- pure TCP-Sockets will do.
Thus I modified the simpleClient from Twisted
(http://twistedmatrix.com/documents/12.2.0/core/examples/simpleclient.py) and
added some protobuf Encoding using varint
(http://code.google.com/p/spinn3r-client/source/browse/src/python/varint.py)
and it does the job. No autobahn.ws this time - but I fixed the issues.
Thanks for the support.

Sure, no problem. Should you ever need to support browser clients as well, we'd be happy to welcome you back to Autobahn;)

Tobias

···

Am 20.05.2013 21:58, schrieb Gerald Madlmayr:

best, Gerald

Am Samstag, 11. Mai 2013 22:19:41 UTC+2 schrieb Gerald Madlmayr:

    Hi,

    I'd like to use Autobahn.ws in combination with Google Protobufs.
    Actually I'm a Java Developer and my Server Infrastructure is
    already up and running with Netty 4.0.0 CR1 + Protobufs 2.5.0.

    When using "standard" Messages over the WebSockets Channel
    everything is fine, but when using Protobufs, I do have an
    encoding/decoding problem, as I'm using HTTP but Googles Protobufs.

    On the Java Server I do have Classes, such as
    ProtobufVarint32FrameDecoder, ProtobufDecoder,
    ProtobufVarint32LengthFieldPrepender and ProtobufEncoder that help
    me to do the Jobs with Netty. So I was wondering if there a similar
    thing for Python as well? I'm new to Pyhton so I might have missed
    something.

    Here is the example that works fine in java:
    https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/worldclock/WorldClockServerInitializer.java
    <https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/worldclock/WorldClockServerInitializer.java>

    Many Thanks in Advance and looking forward to your response

    Kind Regards, Gerald

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

0 Likes