# Stream MP3 from server to client player

**URL:** <https://discourse.nodered.org/t/stream-mp3-from-server-to-client-player/81364>\
**Category:** General\
**Created:** [16 September 2023 09:34 UTC](https://discourse.nodered.org/t/stream-mp3-from-server-to-client-player/81364 "2023-09-16T09:34:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrSidX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrsidx/32/18935_2.png) [@mrSidX](https://discourse.nodered.org/u/mrSidX)\
**Post date:** [16 September 2023 09:34 UTC](https://discourse.nodered.org/t/stream-mp3-from-server-to-client-player/81364/1 "2023-09-16T09:34:46Z")

</div>

I'm trying to serve protected audio content [mp3] via a NR http endpoint:

ie: http in: `xyz.com:1880/audio/foo/` [GET]

I tried to many failed attempts to getting it to work.  
HTTP IN -\> Read File Node (non public mp3) -\> HTTP Response

The Read File node I've tried to set as binary, and multi-part buffer... but can't seem to get these to work.

I've tried to set various headers in the `HTTP Response` node:  
`Content-Type : audio/mpeg`  
`Transfer-Encoding : chunked`  
`Content-Disposition : inline`

and client side:

```auto
    <audio controls>
           <source src="https://xyz.com:1880/audio/foo" type="audio/mpeg">
            Your browser does not support the audio element.
      </audio>

```

The mp3 is fairly lengthy, so chunking the data out is ideal.

I get a blank player with 0:00 length.  
I've also tried to set the `Content-Length` to the byte count of the mp3 file being served.  
Still no go.  
I can easily access the file in public folders, but this defeats the purpose of protecting the content to allow access to authorized users only.

What am I missing?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 November 2023 09:48 UTC](https://discourse.nodered.org/t/stream-mp3-from-server-to-client-player/81364/4 "2023-11-15T09:48:26Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
