Data Serialization in Phoenix Channels

Hey!
Someone knows how to properly serialize data in channels? Can someone advise some serialization tools in the channels?

How data is serialized depends on the transport used by the connection. Channels itself are transport agnostic and therefore don’t know how data is handled in flight.

Now u talking about incoming data?
I mean data that i need to send to client?

It’s the same situation in both ways. The transport implementation does handle serialization and deserialization of messages sent between the server and the client.

so as i see, it’s just JSON in both ways by default

Yes, but not arbitrary json, but messages expect a certain format.

Both longpoll and websocket transports of phoenix support two serializer protocols, which you can find here: https://github.com/phoenixframework/phoenix/blob/v1.4.8/lib/phoenix/socket/serializers/

Hey!
Can i use https://github.com/vt-elixir/ja_serializer or https://github.com/jeregrine/jsonapi for data serialization in channels?