# Using the HTTP API steps needed to get the stream to the server

**URL:** <https://mediasoup.discourse.group/t/using-the-http-api-steps-needed-to-get-the-stream-to-the-server/1404>\
**Category:** mediasoup-demo\
**Created:** [July 7, 2020, 1:02pm UTC](https://mediasoup.discourse.group/t/using-the-http-api-steps-needed-to-get-the-stream-to-the-server/1404 "2020-07-07T13:02:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xplatsolutions](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/xplatsolutions/32/939_2.png) [@xplatsolutions](https://mediasoup.discourse.group/u/xplatsolutions)\
**Post date:** [July 7, 2020, 1:02pm UTC](https://mediasoup.discourse.group/t/using-the-http-api-steps-needed-to-get-the-stream-to-the-server/1404/1 "2020-07-07T13:02:12Z")

</div>

I am creating an iOS application where basic real-time streaming required

- Broadcaster/host streaming video/audio in a room
- Guests join room and stream video/audio

I have integrated [mediasoup-ios-client](https://github.com/ethand91/mediasoup-ios-client) and the web socket iOS library Starscream on the client-side.  
For the server I copied the [mediasoup-demo server](https://github.com/versatica/mediasoup-demo/tree/v3/server) since all the capabilities needed already written there and found it a good place to move fast and understand the mediasoup API better.

I am listing below the steps I am taking and successfully implemented so far in iOS client.

1. websocket is connected:` ["Origin": "wss://192.168.2.4:4443", "Upgrade": "websocket", "Sec-WebSocket-Accept": "9XBEhU0BaApchES+R3iu5FH23OY=", "Connection": "Upgrade", "Sec-WebSocket-Protocol": "protoo"]`
2. Mediasoupclient.initialize()
3. HTTP API getRoomRtpCapabilities `('/rooms/:roomId')`
4. `MediasoupDevice.init`
5. `MediasoupDevice.load(rtpCapabilities)`
6. `mediasoupDevice!.isLoaded()` =\> true
7. HTTP API createBroadcaster `('/rooms/:roomId/broadcasters')` =\> `{"peers":[]}`
8. HTTP API createBroadcasterTransport `('/rooms/:roomId/broadcasters/:broadcasterId/transports')` =\> `{ "iceCandidates" : [...], "dtlsParameters" : { "fingerprints" : [...], "role" : "auto" }, "id" : "...", "iceParameters" : { ... } }`
9. HTTP API connectBroadcasterTransport `('/rooms/:roomId/broadcasters/:broadcasterId/transports/:transportId/connect')` =\> It looks like I don’t receive any JSON response here

Do I need to create a Producer `('/rooms/:roomId/broadcasters/:broadcasterId/transports/:transportId/producers')` and a Consumer `('/rooms/:roomId/broadcasters/:broadcasterId/transports/:transportId/consume')` for the broadcaster/host as next steps?

Client-side after creating the broadcaster transport do I need to cal `MediasoupDevice.createSendTransport` and `MediasoupDevice.createRecvTransport`.

Still wrapping my head around the communication needed, I appreciate your help.

---

<div class="post-metadata">

**Author:** ![jmillan](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/jmillan/32/9_2.png) [@jmillan](https://mediasoup.discourse.group/u/jmillan)\
**Post date:** [July 7, 2020, 2:12pm UTC](https://mediasoup.discourse.group/t/using-the-http-api-steps-needed-to-get-the-stream-to-the-server/1404/2 "2020-07-07T14:12:04Z")

</div>

Hi,

You’re taking a simple demo to build a product or service out of it. Beware that we don’t provide support further than its use `as it is`.

This is the documentation for client-server communication:

> **[mediasoup :: Communication Between Client and Server](https://mediasoup.org/documentation/v3/communication-between-client-and-server/)**
>
> Cutting Edge WebRTC Video Conferencing

On the other hand, I’m quite sure you are already checking the mediasoup-broadcaster-demo which handles good part of what you are asking for.

---

<div class="post-metadata">

**Author:** ![xplatsolutions](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/xplatsolutions/32/939_2.png) [@xplatsolutions](https://mediasoup.discourse.group/u/xplatsolutions)\
**Post date:** [July 7, 2020, 3:17pm UTC](https://mediasoup.discourse.group/t/using-the-http-api-steps-needed-to-get-the-stream-to-the-server/1404/3 "2020-07-07T15:17:04Z")

</div>

I agree, I am really looking into practices and flow to learn and will refactor as soon as I get it up and running and have the knowledge (e.g. rooms and peers into a DB, add authentication/authorization).

The room/peers concept I need is there, I just want to have a proof of concept, in no means I tend to use as is in production 🙂

OK, I need to dive back to this documentation!  
I didn’t really dive in [mediasoup-broadcaster-demo](https://github.com/versatica/mediasoup-broadcaster-demo), getting into it right away.

@jmillan thank you for the response, sometimes handling new tech (WebRTC) and frameworks (mediasoup) + new languages to learn (Swift, TypeScript) you need community support like this one! I appreciate your help.
