shareup / phoenix-apple

3 stars 0 forks source link

Add RawOutgoingMessage and RawIncomingMessage #23

Closed atdrendel closed 3 years ago

atdrendel commented 3 years ago

This pull request simplifies OutgoingMessageEncoder and IncomingMessageDecoder by introducing RawOutgoingMessage and RawIncomingMessage. This prevents the user from accidentally encoding an WebSocketMessage.open, and it also makes it clear the user shouldn't try to decode WebSocketMessage.open, either. Additionally, this allows custom encoders to determine how the WebSocket should send the message: as a binary or as text.