title: How do I specify my own Phoenix Channel JSON Serializer?
body: <p>In my endpoint, I've got something that looks like:</p>
  
  <pre><code>  socket "/socket", MarsWeb.UserSocket,
      websocket: [transport: Phoenix.Transports.WebSocket, serializer: {MarsWeb.JsonCamelSerializer, "~&gt;2.0"}],
  </code></pre>
  
  <p>I'm trying to replace the JSON serializer with my own one (that encodes camelcase on the outgoing messages).</p>
  
  <p>I know this syntax isn't right; how should it look?</p>
  
  <p>Update:</p>
  
  <p>So for the purpose of testing, I set it up like this:</p>
  
  <pre><code>  socket "/socket", MarsWeb.UserSocket,
         websocket: [transport: Phoenix.Transports.Websocket, serializer: 
         Phoenix.Socket.V2.JSONSerializer]
  </code></pre>
  
  <p>But it actually doesn't work:</p>
  
  <pre><code>** (FunctionClauseError) no function clause matching in Phoenix.Socket.negotiate_serializer/2
      (phoenix 1.4.15) lib/phoenix/socket.ex:613: Phoenix.Socket.negotiate_serializer(Phoenix.Socket.V2.JSONSerializer, "2.0.0")
  </code></pre>
  
  <p>I think there's this extra issue of a version number, and looking in the source, it looks like it needs a tuple...</p>