title: Private video streaming for Amazon CloudFront in ruby
body: <h2>How does signed URLs work for streamed videos in Amazon CloudFront?</h2>
  
  <p>I'm using <a href="https://github.com/stlondemand/aws_cf_signer" rel="nofollow">aws_cf_signer</a> gem, but can't get signed urls work for rtmp streamed mp4-file. For static files, like text.txt it works fine, but not when I have streaming distribution.</p>
  
  <h3>Example:</h3>
  
  <p>I have file named test.mp4 so how do I get signed url out of <code>signer.sign()</code>?</p>
  
  <p>E.g. <code>signed_url = signer.sign('rtmp://xyz.cloudfront.net/test', :ending =&gt; Time.now + 3600)</code> does not produce working url. I have tested URLs with VLC player and <code>rtmpdump</code></p>
  
  <p>The distribution itself is created with <a href="https://github.com/boto/boto" rel="nofollow">boto</a> like this:</p>
  
  <blockquote>
    <p>stream_dist = cf.create_streaming_distribution(origin=origin,
    enabled=True,
                trusted_signers=["Self"],
                comment="test distribution")</p>
  </blockquote>