title: Audio stream relay with Ruby
body: <p>I am trying to develop an audio stream relay using <a href="https://github.com/igrigorik/em-proxy" rel="nofollow">em-proxy</a>.</p>
  
  <p>Things like authentication and logging work out pretty well. The issue is that, every new incoming connection leads to a new connection to the audio stream.</p>
  
  <p>A partial of my code:</p>
  
  <pre><code>require 'em-proxy'
  
  host = "0.0.0.0"
  port = 9889
  puts "listening on #{host}:#{port}..."
  
  Proxy.start(:host =&gt; host, :port =&gt; port) do |conn|
  
    conn.server :srv, host: "127.0.0.1", port: 8000
  
    conn.on_data do |data|
      # logging happens here
      data
    end
  
    conn.on_finish do |backend, name|
      # logging too
      unbind
    end
  
  end
  </code></pre>
  
  <p>Ideally, I would like to have only one connection to the audio stream.</p>
  
  <p>Any ideas?</p>