<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="58054" data-post-id="58054">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="satom99" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/satom99/120/7286_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  satom99
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>From the <a href="https://github.com/satom99/phx_raws#example" rel="noopener nofollow ugc">example</a>, adding <code>.Raw</code> to the transport is the only change you need to do in order to get it working - in comparsion to a regular socket setup (with channels) one would have. I assume you have this.</p>
<p>We have discussed changing the syntax <a href="https://github.com/satom99/phx_raws/issues/1" rel="noopener nofollow ugc">here</a>, but for now if you want to send data to the client you may do <code>send socket_pid, {:binary, some_binary}</code> or have this tuple returned on the <code>handle</code> callback - as shown in the example. Have a look <a href="https://github.com/ninenines/cowboy/blob/master/src/cowboy_websocket.erl#L45" rel="noopener nofollow ugc">here</a> for a reference on op codes.</p>
<p>Would you mind sharing your code as well?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="58054" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/plan-old-websockets-in-phoenix-but-without-magic/10074/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-58054" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="58054"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="58055" data-post-id="58055">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Licenser" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Licenser/120/7123_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Licenser
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Sadly that doesn’t solve the problem, I used that and I kept getting the following error:</p>
<pre><code>[error] Ranch protocol #PID&lt;0.514.0&gt; (:cowboy_protocol) of listener CloudUiWeb.Endpoint.HTTP terminated
** (exit) an exception was raised:
** (FunctionClauseError) no function clause matching in :cowboy_websocket.websocket_opcode/1
    (cowboy) /Users/heinz/Projects/fifo/core/cloud_ui/deps/cowboy/src/cowboy_websocket.erl:652: :cowboy_websocket.websocket_opcode(:data)
    (cowboy) /Users/heinz/Projects/fifo/core/cloud_ui/deps/cowboy/src/cowboy_websocket.erl:699: :cowboy_websocket.websocket_send/2
    (cowboy) /Users/heinz/Projects/fifo/core/cloud_ui/deps/cowboy/src/cowboy_websocket.erl:618: :cowboy_websocket.handler_call/7
    (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:49: Phoenix.Endpoint.CowboyWebSocket.resume/3
    (cowboy) /Users/heinz/Projects/fifo/core/cloud_ui/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
16:25:51.313 [error] Error in process &lt;0.514.0&gt; with exit value:
{function_clause,[{cowboy_websocket,websocket_opcode,[data],[{file,"/Users/heinz/Projects/fifo/core/cloud_ui/deps/cowboy/src/cowboy_websocket.erl"},{line,652}]},{cowboy_websocket,websocket_send,2,[{file,"/Users/heinz/Projects/fifo/core/cloud_ui/deps/cowboy/src/cowboy_websocket.erl"},{line,699}]},{cowboy_websocket,handler_call,7,[{file,"/Users/heinz/Projects/fifo/core/cloud_ui/deps/cowboy/src/cowboy_websocket.erl"},{line,618}]},{'Elixir.Phoenix.Endpoint.CowboyWebSocket',resume,3,[{file,"lib/phoenix/endpoint/cowboy_websocket.ex"},{line,49}]},{cowboy_protocol,execute,4,[{file,"/Users/heinz/Projects/fifo/core/cloud_ui/deps/cowboy/src/cowboy_protocol.erl"},{line,442}]}]}
16:25:51.313 [error] Ranch listener 'Elixir.CloudUiWeb.Endpoint.HTTP' terminated with reason: no function clause matching cowboy_websocket:websocket_opcode(data) line 652
</code></pre>
<p>Since phoenix tries to put the first argument thorugh <code>webxocket_opcode/1</code></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="58055" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/plan-old-websockets-in-phoenix-but-without-magic/10074/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-58055" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="58055"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="58058" data-post-id="58058">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="satom99" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/satom99/120/7286_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  satom99
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I see that error coming from Cowboy itself, because there’s <em>no function clause matching</em> in <code>websocket_opcode(:data)</code>. Which I assume is caused by that atom not being a registered <a href="https://github.com/ninenines/cowboy/blob/master/src/cowboy_websocket.erl#L45" rel="noopener nofollow ugc">op code</a> <code>(text | binary | ping | pong)</code>, I guess <code>:binary</code> should work just fine. <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="58058" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/plan-old-websockets-in-phoenix-but-without-magic/10074/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-58058" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="58058"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="58063" data-post-id="58063">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Licenser" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Licenser/120/7123_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Licenser
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>it might but that’d require rewriting the library sending <code>{:data, ...}</code>  the data and every other applicaiton using it. Not to mention that it’s a horrible hack. I mean it’s not sane that <code>:binary</code> means data send to the socket and <code>:text</code> means data from the socket just because well, because otherwise it explodes.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="58063" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/plan-old-websockets-in-phoenix-but-without-magic/10074/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-58063" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="58063"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="58071" data-post-id="58071">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="satom99" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/satom99/120/7286_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  satom99
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Do you mean that incoming data (that-is data received from the client) is sent over to the <code>handle</code> function with a <code>:text</code> op code only? And that outgoing data (that-is data sent to the client) is to be set as <code>:binary</code>?</p>
<p>That is not the case. You may receive both <code>:text</code> and <code>:binary</code>, as well as <code>:ping</code> and <code>:pong</code> from the client. Thus you may as well send either of those to the client.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def handle(opcode, data, state) do
  case opcode do
    :text -&gt;
      IO.inspect "text!"
      IO.inspect data
    :binary -&gt;
      IO.inspect "binary!"
      IO.inspect data
    :ping -&gt;
      IO.inspect "ping!"
    :pong -&gt;
      IO.inspect "pong!"
    :closed -&gt; # not an actual opcode, this is a 'somewhat custom' phx_raws event
      IO.inspect "rip"
      IO.inspect data # reason
  end

  send self(), {:text, "Hello user!"}
  send self(), {:binary, ...}
  send self(), {:ping, ...}
  send self(), {:pong, ...}
  send self(), {:close, "Goodbye!"}

  :ok
end
</code></pre>
<p>For instance, the readme example is an echo server. Upon connection, a <code>Welcome!</code> text message is sent to the client. And whenever a text message is received from the client, the exact same message is sent back.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="58071" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/plan-old-websockets-in-phoenix-but-without-magic/10074/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-58071" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="58071"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="58085" data-post-id="58085">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Licenser" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Licenser/120/7123_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Licenser
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="satom99" data-post="16" data-topic="10074">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/satom99/48/7286_2.png" class="avatar"> satom99:</div>
<blockquote>
<p>Do you mean that incoming data (that-is data received from the client) is sent over to the handle function with a :text op code only? And that outgoing data (that-is data sent to the client) is to be set as :binary?</p>
</blockquote>
</aside>
<p>Nono, I understand how opcode work, I mean that Socket interprets every message the process gets as an opcode.</p>
<p>I think I’m really bad at explaining it, let me try with some examples:</p>
<p>We got:</p>
<p><code>B</code> - A browser (web socket client)</p>
<p><code>S</code> - The <code>Phoenix.Socket</code> process using <code>transport :websocket, Phoenix.Transports.WebSocket.Raw</code></p>
<p><code>E</code> - An endpoint <strong>process</strong> that somewhere else.</p>
<p>What I try to build is an <code>S</code> that sends all data it gets form <code>E</code> to <code>B</code> and all data it gets form <code>B</code> to <code>E</code>. So basically:</p>
<pre><code>defmodule S do
  use Phoenix.Socket
  transport :websocket, Phoenix.Transports.WebSocket.Raw
  # data coming from B gets send to E
  def handle(:text, message, %{endpoint: endpoint}) do
    FancyLib.send_data(producer, message)
    :ok
  end

  # data coming from E gets send to B
  def handle(:data, message, _state) do
    {:text, message}
  end
end
</code></pre>
<p>(semi pseudocodeish)</p>
<p>The problem here is that I can’t find a sane way to send data to S, as all messages that go there get forced through Phoenix.Socket and are interpreted as opcode messages.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="58085" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/plan-old-websockets-in-phoenix-but-without-magic/10074/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-58085" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="58085"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="58091" data-post-id="58091">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="satom99" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/satom99/120/7286_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  satom99
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>If I understood you right, this is what we have:</p>
<ul>
<li>A client <code>C</code> sends a message to the server <code>S</code></li>
<li>The server forwards this message to a process <code>P</code></li>
<li>This process does something with the client’s message  and sends a reply to the client<br>
<code>Client &gt; Server &gt; Process &gt; Client</code></li>
</ul>
<p>What is <code>FancyLib</code>? Why are you defining <code>handle(:data, ...)</code> - there is no such opcode?</p>
<hr>
<p>Let me introduce an example.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Socket do
  use Phoenix.Socket

  transport :websocket, Phoenix.Transports.Websocket.Raw

  def handle(:text, message, state) do
    Something.dothing(message)

    :ok        
  end
end

defmodule Something do
  use GenServer

  def start_link do
    # Start a GenServer on this module and give it a name
    GenServer.start_link __MODULE__, [], name: PotatoServer
  end

  def dothing(message) do
    GenServer.call PotatoServer, {:in, message}
  end

  def handle_call({:in, message}, from, state) do
    # message = message received from the client
    # from = socket PID, the process that called the GenServer
    
    IO.inspect message

    send from, {:text, "I received this: #{message}"}

    {:noreply, state}
  end
end
</code></pre>
<p>Say you have a GenServer running named <code>PotatoServer</code>. Following the scheme, we would have a client sending a message to the server, this message forwarded to the GenServer process, and finally this GenServer would send a message back to the client. <code>Client &gt; Server &gt; PotatoServer &gt; Client</code>.</p>
<p>Essentially, by <code>name:</code>'ing a GenServer we are able to refer to it by name instead of using its PID, which is what we are doing when <code>.call</code>’ing.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="58091" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/plan-old-websockets-in-phoenix-but-without-magic/10074/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-58091" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="58091"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="58094" data-post-id="58094">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Licenser" data-post="9" data-topic="10074">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/licenser/48/7123_2.png" class="avatar"> Licenser:</div>
<blockquote>
<p>I interpret this as the live reload server endpoint missing, I hoped the :_ case would provide that but it seems it’s not and I couldn’t figure out where in the phoenix code it was defined to add it like the /socket/websocket endpoint</p>
</blockquote>
</aside>
<p>You need to have something like this in you endpoint config:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">http: [
    dispatch: [
      {:_, [
        {"/raw_socket", MyAppWeb.RawSocket, []},
        {"/phoenix/live_reload/socket/websocket", Phoenix.Endpoint.CowboyWebSocket,
          {Phoenix.Transports.WebSocket, {MyAppWeb.Endpoint, Phoenix.LiveReloader.Socket, :websocket}}
        },
        {:_, Plug.Adapters.Cowboy.Handler, {MyAppWeb.Endpoint, []}}
      ]}
    ]
</code></pre>
<p>Notes:</p>
<ul>
<li>you should only include the second entry (live reload socket route) in <code>:dev</code> environment</li>
<li>you might need to include <code>https</code> config as well/instead</li>
</ul>
<p>Now, you can use the standard cowboy handler, for example:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule CustomDispatchWeb.RawSocket do
  @behaviour :cowboy_websocket_handler

  def init({_transport, :http}, _req, _opts), do:
    {:upgrade, :protocol, :cowboy_websocket}

  def websocket_init(_transport, req, _opts), do:
    {:ok, req, nil}

  def websocket_handle(_msg, req, state), do:
    {:ok, req, state}

  def websocket_info(_msg, req, state), do:
    {:ok, req, state}

  def websocket_terminate(_reason, _req, _state), do:
    :ok
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="58094" data-batch-url="/posts/batch_likers">
                        8
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/plan-old-websockets-in-phoenix-but-without-magic/10074/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-58094" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="58094"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-solved cat-solved" title="Marked as solution"></div>
  </section>
</div>
    <div class="postbit" id="58098" data-post-id="58098">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Licenser" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Licenser/120/7123_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Licenser
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="sasajuric" data-post="19" data-topic="10074">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"> sasajuric:</div>
<blockquote>
<p>You need to have something like this in you endpoint config</p>
</blockquote>
</aside>
<p>Thank you <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"> that does the trick!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="58098" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/plan-old-websockets-in-phoenix-but-without-magic/10074/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-58098" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="58098"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="150908" data-post-id="150908">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="greentornado" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/greentornado/120/5004_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  greentornado
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>how to use pg2 pubsub in raw websocket like phoenix channel please ?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="150908" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/plan-old-websockets-in-phoenix-but-without-magic/10074/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-150908" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="150908"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/10074/load_more?page=3">Load more posts</a>
</div></template></turbo-stream>