Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seems to add escaping not needed to SockJS communication #5

Open
mkotsbak opened this issue May 19, 2015 · 2 comments
Open

Seems to add escaping not needed to SockJS communication #5

mkotsbak opened this issue May 19, 2015 · 2 comments

Comments

@mkotsbak
Copy link

In Chrome websocket monitoring, it seems like the messages sent through the websocket looks like this:

["{"req":{"path":["shared","Api","echo"],"args":{"s":"\"Test fra klient med client i val\""}},"id":1}"]

a["{"res":"\"Received on server: Test fra klient med client i val\"","id":1}"]

Why are all "-s escaped? I'm not sure if it is this library or SockJS that does it.

It is sort of ok if both the client and the server is using the library, but if there are some other manually created clients written in another programming language, it would be hard to replicate the protocol.

Maybe it instead could use the JSON-RPC protocol?: http://en.wikipedia.org/wiki/JSON-RPC

@OlivierBlanvillain
Copy link
Owner

Why are all "-s escaped? I'm not sure if it is this library or SockJS that does it.

This is related to the way remote procedure call are handled. The RPCWrapper uses Autowire and uPickle, which I think can be tuned to use whatever RPC representation / serialization format you like.

@mkotsbak
Copy link
Author

mkotsbak commented Jun 1, 2015

Would it be possible to use Js.Value instead of Strring in RpcWrapper.scala as proposed in the references issue in Autowire above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants