# Working example on Github with 80 and 443 ports only?

**URL:** <https://mediasoup.discourse.group/t/working-example-on-github-with-80-and-443-ports-only/2570>\
**Category:** mediasoup libraries\
**Created:** [March 14, 2021, 11:06am UTC](https://mediasoup.discourse.group/t/working-example-on-github-with-80-and-443-ports-only/2570 "2021-03-14T11:06:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![atonamy](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/atonamy/32/875_2.png) [@atonamy](https://mediasoup.discourse.group/u/atonamy)\
**Post date:** [March 14, 2021, 11:07am UTC](https://mediasoup.discourse.group/t/working-example-on-github-with-80-and-443-ports-only/2570/1 "2021-03-14T11:07:00Z")

</div>

Our users has limited internet access to tcp ports 443 and 80 only nothing else is possible to open for them (even udp access).  
I saw [this topic](https://mediasoup.discourse.group/t/limit-rtc-port-range-for-client/453/6) but didn’t see any example anywhere how exactly setup and configure mediasoup to work only with 443 and 80 tcp ports (is not possible to open ports range for rtc)?  
Any advice or suggestion where to get started? Ideally if someone could provide source code example on Github or any other public repository.

---

<div class="post-metadata">

**Author:** ![dimoochka](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/dimoochka/32/858_2.png) [@dimoochka](https://mediasoup.discourse.group/u/dimoochka)\
**Post date:** [March 14, 2021, 2:07pm UTC](https://mediasoup.discourse.group/t/working-example-on-github-with-80-and-443-ports-only/2570/2 "2021-03-14T14:07:59Z")

</div>

You need a TURN server for this. It essentially acts as a proxy server between port 443 and a WebRTC destination (mediasoup).

> **[Setting up a TURN server with Node: Production-ready](https://helderesteves.com/setting-up-a-turn-server-with-node-production-ready/)**
>
> In this guide, you'll learn how to set up a TURN relaying server and how to configure it to use with Node.JS for a production app.The problemIf you're

> **[coturn/coturn](https://github.com/coturn/coturn)**
>
> coturn TURN server project. Contribute to coturn/coturn development by creating an account on GitHub.

This package is easier to understand than coturn but does not support TLS:

> **[node-turn](https://www.npmjs.com/package/node-turn)**
>
> STUN/TURN Server

---

<div class="post-metadata">

**Author:** ![atonamy](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/atonamy/32/875_2.png) [@atonamy](https://mediasoup.discourse.group/u/atonamy)\
**Post date:** [March 15, 2021, 12:14am UTC](https://mediasoup.discourse.group/t/working-example-on-github-with-80-and-443-ports-only/2570/3 "2021-03-15T00:14:09Z")

</div>

Thanks, I will have a look.

---

<div class="post-metadata">

**Author:** ![OllieJones](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/olliejones/32/850_2.png) [@OllieJones](https://mediasoup.discourse.group/u/OllieJones)\
**Post date:** [March 18, 2021, 12:56pm UTC](https://mediasoup.discourse.group/t/working-example-on-github-with-80-and-443-ports-only/2570/4 "2021-03-18T12:56:17Z")

</div>

You configure your STUN / TURN servers on your clients via the Client API. `device.createRecvTransport()` and `device.createSendTransport()` both accept the [transportOptions](https://mediasoup.org/documentation/v3/mediasoup-client/api/#TransportOptions) parameter, and one of its properties, ‘iceServers’, is an array of [RTCIceServer](https://w3c.github.io/webrtc-pc/#rtciceserver-dictionary) objects. If you omit that parameter then everything uses MediaSoup’s ICE Lite mode. But that mode isn’t friendly to restrictive enterprise firewalls.

I use the free tier of STUN / TURN servers from the [xirsys.com](http://xirsys.com) STaaS (yeah, guess what that acronym means) for testing. The `iceServers` property value they give me from their API is is this. You’ll need your own account credentials.

STUN is a super-cheap service to provide so there are some freely available servers for it. But TURN is more costly: those servers relay (receive and send) media data. So, typically we pay for that service, or stand up our own TURN servers. I’m too lazy to do the latter, hence [xirsys.com](http://xirsys.com).

```auto
[
    {
      username:'REDACTED',
      urls:[
        'stun:us-turn1.xirsys.com',
        'turn:us-turn1.xirsys.com:80?transport=udp',
        'turn:us-turn1.xirsys.com:3478?transport=udp',
        'turn:us-turn1.xirsys.com:80?transport=tcp',
        'turn:us-turn1.xirsys.com:3478?transport=tcp',
        'turns:us-turn1.xirsys.com:443?transport=tcp',
        'turns:us-turn1.xirsys.com:5349?transport=tcp'
      ],
      credential:'REDACTED'
    }
]

```

I have a hack of mediasoup-sandbox [here](https://github.com/OllieJones/mediasoup-sandbox) that does this. There’s a function at the end of server.js to access Xirsys’s API.
