# Why browser always websocket connection fail when connect to my mediasoup server?

**URL:** <https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354>\
**Category:** mediasoup-demo\
**Created:** [October 25, 2019, 10:30am UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354 "2019-10-25T10:30:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![704817030](https://avatars.discourse-cdn.com/v4/letter/7/6a8cbe/32.png) [@704817030](https://mediasoup.discourse.group/u/704817030)\
**Post date:** [October 25, 2019, 10:30am UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354/1 "2019-10-25T10:30:13Z")

</div>

I have deploy the demo in my aliyun following the install instruction in github mediasoup-demo ,and I config the port of 4443,3000,3001,40000-49999 in console of Aliyun. Now I can open website like this : [https://www.vimsvideo.com:3000](https://www.vimsvideo.com:3000), and get the page of client demo.  
But the browser always hint ‘websocket connection fail’ ,and then I can’t join the meeting .

I am sure I open the port above,How can I solve this problem? Is there anything I missed?

---

<div class="post-metadata">

**Author:** ![704817030](https://avatars.discourse-cdn.com/v4/letter/7/6a8cbe/32.png) [@704817030](https://mediasoup.discourse.group/u/704817030)\
**Post date:** [October 25, 2019, 10:37am UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354/2 "2019-10-25T10:37:38Z")

</div>

I make the fullchain.pem and privkey.pem by using letsencrypt ,and copy it the server/certs ,it seems it work so I can open the page in chrome,but the browser can’t connect websocket, so it throw out the hint “Websocket connection fail”.

and the picture of screen is here.

 ![QQ%E5%9B%BE%E7%89%8720191025183629](https://global.discourse-cdn.com/free1/uploads/mediasoup/original/1X/1f12c586b88f42ca4bedc52ef116b0c92d365231.png) !

---

<div class="post-metadata">

**Author:** ![704817030](https://avatars.discourse-cdn.com/v4/letter/7/6a8cbe/32.png) [@704817030](https://mediasoup.discourse.group/u/704817030)\
**Post date:** [October 25, 2019, 10:38am UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354/3 "2019-10-25T10:38:26Z")

</div>

![QQ%E5%9B%BE%E7%89%8720191025183643](https://global.discourse-cdn.com/free1/uploads/mediasoup/original/1X/d235d416cdd43c251ddf53898e9433778911f75f.png)

---

<div class="post-metadata">

**Author:** ![704817030](https://avatars.discourse-cdn.com/v4/letter/7/6a8cbe/32.png) [@704817030](https://mediasoup.discourse.group/u/704817030)\
**Post date:** [October 25, 2019, 10:39am UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354/4 "2019-10-25T10:39:09Z")

</div>

![QQ%E5%9B%BE%E7%89%8720191025183647](https://global.discourse-cdn.com/free1/uploads/mediasoup/original/1X/b9112ff6777b0ebc5912f7f3535363eedeef6c89.png)

---

<div class="post-metadata">

**Author:** ![704817030](https://avatars.discourse-cdn.com/v4/letter/7/6a8cbe/32.png) [@704817030](https://mediasoup.discourse.group/u/704817030)\
**Post date:** [October 25, 2019, 10:39am UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354/5 "2019-10-25T10:39:52Z")

</div>

![QQ%E5%9B%BE%E7%89%8720191025183650](https://global.discourse-cdn.com/free1/uploads/mediasoup/original/1X/fb04f8af033955f3f0ffa06181c674187746f0ea.png)

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [October 25, 2019, 11:13am UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354/7 "2019-10-25T11:13:34Z")

</div>

I don’t know what “aliyun” is. Please, report text rather than images/screenshots.

---

<div class="post-metadata">

**Author:** ![704817030](https://avatars.discourse-cdn.com/v4/letter/7/6a8cbe/32.png) [@704817030](https://mediasoup.discourse.group/u/704817030)\
**Post date:** [October 25, 2019, 11:31am UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354/8 "2019-10-25T11:31:27Z")

</div>

Aliyun is [www.aliyun.com](http://www.aliyun.com), the cloud provider in china.  
my website can you access the website : [https://www.vimsvideo.com:3000](https://www.vimsvideo.com:3000) ?

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [October 25, 2019, 12:09pm UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354/9 "2019-10-25T12:09:44Z")

</div>

I’m sorry. The mediasoup-demo app is not designed to be hosted with `gulp live`:

> **[versatica/mediasoup-demo](https://github.com/versatica/mediasoup-demo/#deploy-it-in-a-server)**
>
> mediasoup official demo application. Contribute to versatica/mediasoup-demo development by creating an account on GitHub.

I hope other users here can help you. I cannot help on this, sorry.

---

<div class="post-metadata">

**Author:** ![704817030](https://avatars.discourse-cdn.com/v4/letter/7/6a8cbe/32.png) [@704817030](https://mediasoup.discourse.group/u/704817030)\
**Post date:** [October 25, 2019, 12:26pm UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354/10 "2019-10-25T12:26:37Z")

</div>

all right , I am a newer to MediaSoup , so there are so many things I have to learn.  
BTW, in fact , I hope to deploy mediasoup in local network ,for my udp streams in TV Station delieve to mediasoup , to achieve a result of low latency broadcasting and decoding in H5 browser page instead of RTMP or HLS protocol . Can it do that ?

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [October 25, 2019, 12:41pm UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354/11 "2019-10-25T12:41:42Z")

</div>

Please read the full mediasoup documentation to learn what it can do. BTW mediasoup requires RTP as input (can be WebRTC SRTP or plain RTP over UDP). No idea how your TV UDP streams are.

---

<div class="post-metadata">

**Author:** ![704817030](https://avatars.discourse-cdn.com/v4/letter/7/6a8cbe/32.png) [@704817030](https://mediasoup.discourse.group/u/704817030)\
**Post date:** [October 26, 2019, 3:10am UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354/12 "2019-10-26T03:10:34Z")

</div>

I look at chrome console , I found that ,the websocket cannot connect to WSS 4443, but I still don’t know how to solve it.maybe it is only related to the certificate ssl problem.

 ![QQ%E5%9B%BE%E7%89%8720191026110859](https://global.discourse-cdn.com/free1/uploads/mediasoup/original/1X/66468b9088f334810fdd5286046f860e25839679.png)

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [December 2, 2019, 11:10pm UTC](https://mediasoup.discourse.group/t/why-browser-always-websocket-connection-fail-when-connect-to-my-mediasoup-server/354/13 "2019-12-02T23:10:59Z")

</div>


