Data Serialization in Phoenix Channels

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:

Can i use or for data serialization in channels?