# Websocket wss failed

**URL:** <https://openvidu.discourse.group/t/websocket-wss-failed/3501>\
**Category:** Issues developing apps\
**Tags:** v2\
**Created:** [October 18, 2021, 12:37am UTC](https://openvidu.discourse.group/t/websocket-wss-failed/3501 "2021-10-18T00:37:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![andyzhou](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/andyzhou/32/1705_2.png) [@andyzhou](https://openvidu.discourse.group/u/andyzhou)\
**Post date:** [October 18, 2021, 12:37am UTC](https://openvidu.discourse.group/t/websocket-wss-failed/3501/1 "2021-10-18T00:37:36Z")

</div>

hello,  
I’ve compiled and installed an openvidu server and classroom-demo in Ubuntu 20.04.  
but the classroom-demo browser can’t see the video , and reports error in console:

```auto
WebSocket connection to 'wss://18.183.92.166:4443/openvidu?sessionId=ses_NtupFDW3OG' failed: main.js 1 

```

I tested curl in another mac, it seems ok.  
so what’s the problem?

logs:

```auto
zhh@/Users/zhh $ curl -k --no-buffer -H 'Connection: keep-alive, Upgrade' -H 'Upgrade: websocket' -v -H 'Sec-WebSocket-Version: 13' -H 'Sec-WebSocket-Key: websocket' https://18.183.92.166:4443/openvidu\?sessionId\=ses_NtupFDW3OG ws | od -t c
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 18.183.92.166...
* TCP_NODELAY set
* Connected to 18.183.92.166 (18.183.92.166) port 4443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /Users/zhh/anaconda3/ssl/cacert.pem
  CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
} [5 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* TLSv1.2 (IN), TLS handshake, Server hello (2):
{ [81 bytes data]
* TLSv1.2 (IN), TLS handshake, Certificate (11):
{ [913 bytes data]
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
{ [333 bytes data]
* TLSv1.2 (IN), TLS handshake, Server finished (14):
{ [4 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
} [70 bytes data]
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS handshake, Finished (20):
} [16 bytes data]
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
{ [1 bytes data]
* TLSv1.2 (IN), TLS handshake, Finished (20):
{ [16 bytes data]
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: C=ES; ST=Some-State; O=OpenVidu; emailAddress=openvidu@gmail.com
* start date: May 30 15:24:17 2017 GMT
* expire date: May 28 15:24:17 2027 GMT
* issuer: C=ES; ST=Some-State; O=OpenVidu; emailAddress=openvidu@gmail.com
* SSL certificate verify result: self signed certificate (18), continuing anyway.
} [5 bytes data]
> GET /openvidu?sessionId=ses_NtupFDW3OG HTTP/1.1
> Host: 18.183.92.166:4443
> User-Agent: curl/7.61.0
> Accept: */*
> Connection: keep-alive, Upgrade
> Upgrade: websocket
> Sec-WebSocket-Version: 13
> Sec-WebSocket-Key: websocket
>
{ [5 bytes data]
< HTTP/1.1 101
< Vary: Origin
< Vary: Access-Control-Request-Method
< Vary: Access-Control-Request-Headers
< Set-Cookie: OVJSESSIONID=FDC43529EAEDBCF6D747E33F569A6C6D; Path=/; Secure; HttpOnly
< Upgrade: websocket
< Connection: upgrade, keep-alive
< Sec-WebSocket-Accept: qVby4apnn2tTYtB1nPPVYUn68gY=
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: 0
< Strict-Transport-Security: max-age=31536000 ; includeSubDomains
< X-Frame-Options: DENY
< Date: Mon, 18 Oct 2021 00:18:01 GMT
< Keep-Alive: timeout=60
```

---

<div class="post-metadata">

**Author:** ![cruizba](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/cruizba/32/18_2.png) [@cruizba](https://openvidu.discourse.group/u/cruizba)\
**Post date:** [October 18, 2021, 8:52am UTC](https://openvidu.discourse.group/t/websocket-wss-failed/3501/2 "2021-10-18T08:52:09Z")

</div>

Is your classroom-demo running through https at the same ip `18.183.92.166` ?

---

<div class="post-metadata">

**Author:** ![andyzhou](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/andyzhou/32/1705_2.png) [@andyzhou](https://openvidu.discourse.group/u/andyzhou)\
**Post date:** [October 18, 2021, 12:42pm UTC](https://openvidu.discourse.group/t/websocket-wss-failed/3501/3 "2021-10-18T12:42:06Z")

</div>

yes, through https. but with deferent port and the port is 5000.  
and the openvidu port is 4443.

---

<div class="post-metadata">

**Author:** ![cruizba](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/cruizba/32/18_2.png) [@cruizba](https://openvidu.discourse.group/u/cruizba)\
**Post date:** [October 18, 2021, 12:46pm UTC](https://openvidu.discourse.group/t/websocket-wss-failed/3501/4 "2021-10-18T12:46:11Z")

</div>

Please, can you describe how did you deploy OpenVidu, and how are you deploying the classroom-demo?

---

<div class="post-metadata">

**Author:** ![andyzhou](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/andyzhou/32/1705_2.png) [@andyzhou](https://openvidu.discourse.group/u/andyzhou)\
**Post date:** [October 18, 2021, 1:17pm UTC](https://openvidu.discourse.group/t/websocket-wss-failed/3501/5 "2021-10-18T13:17:57Z")

</div>

I run compile openvidu and classroom-demo source and configue application.properties.  
then run command:

```auto
 mvn exec:java

```

---

<div class="post-metadata">

**Author:** ![andyzhou](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/andyzhou/32/1705_2.png) [@andyzhou](https://openvidu.discourse.group/u/andyzhou)\
**Post date:** [October 18, 2021, 1:22pm UTC](https://openvidu.discourse.group/t/websocket-wss-failed/3501/6 "2021-10-18T13:22:09Z")

</div>

My kurento will shut down the video about 150seconds, also a problem.

I deloyed a docker kurento with independented coturn.

and I run the tutorial HelloWorldApp.

But the video will broken automatically about 150seconds.

What’s the probably problem?

when the remote video is automatically stopped, I click Stop, chrome console will display:

“[sendMessage] Skip, WebSocket session isn’t open”

this is the logs of HelloWorldApp. thank you all!

```auto

2021-10-15 02:30:50.955 INFO 551016 --- [ventExec-e2-t30] org.kurento.tutorial.helloworld.Handler : [WebRtcEndpoint::MediaFlowInStateChange] source: user33d6112e-4606-26f0-31ea-251b67328709_webrtcendpoint, timestamp: 1634265050, tags: [], state: FLOWING, padName: default, mediaType: VIDEO

2021-10-15 02:30:51.082 INFO 551016 --- [ventExec-e2-t30] org.kurento.tutorial.helloworld.Handler : [WebRtcEndpoint::MediaStateChanged] source: user33d6112e-4606-26f0-31ea-251b67328709_webrtcendpoint, timestamp: 1634265051, tags: [], oldState: DISCONNECTED, newState: CONNECTED

2021-10-15 02:33:17.594 ERROR 551016 --- [nio-8443-exec-8] org.kurento.tutorial.helloworld.Handler : [Handler::handleTransportError] Exception: java.io.EOFException, sessionId: 33d6112e-4606-26f0-31ea-251b67328709

2021-10-15 02:33:17.595 WARN 551016 --- [nio-8443-exec-8] org.kurento.tutorial.helloworld.Handler : [Handler::afterConnectionClosed] status: CloseStatus[code=1011, reason=null], sessionId: 33d6112e-4606-26f0-31ea-251b67328709

2021-10-15 02:33:17.595 INFO 551016 --- [nio-8443-exec-8] org.kurento.tutorial.helloworld.Handler : [Handler::stop] Release the Media Pipeline

```

---

<div class="post-metadata">

**Author:** ![andyzhou](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/andyzhou/32/1705_2.png) [@andyzhou](https://openvidu.discourse.group/u/andyzhou)\
**Post date:** [October 18, 2021, 1:27pm UTC](https://openvidu.discourse.group/t/websocket-wss-failed/3501/7 "2021-10-18T13:27:01Z")

</div>

[https://mydomain.com:4443/dashboard/#/](https://mydomain.com:4443/dashboard/#/)  
Error connecting to session: [0] Http failure response for [https://18.183.92.166:4443/openvidu/api/sessions:](https://18.183.92.166:4443/openvidu/api/sessions:) 0 Unknown Error  
in chrome console,it reports error:

```auto
Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID

```

But if I using the IP to connect will be ok.  
[https://18.183.92.166:4443/dashboard/#/](https://18.183.92.166:4443/dashboard/#/)

what’s the problem?

---

<div class="post-metadata">

**Author:** ![cruizba](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/cruizba/32/18_2.png) [@cruizba](https://openvidu.discourse.group/u/cruizba)\
**Post date:** [October 18, 2021, 1:38pm UTC](https://openvidu.discourse.group/t/websocket-wss-failed/3501/8 "2021-10-18T13:38:42Z")

</div>

Are you deploying in a VPS, or you’re just trying OpenVidu in your LAN network?

---

<div class="post-metadata">

**Author:** ![cruizba](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/cruizba/32/18_2.png) [@cruizba](https://openvidu.discourse.group/u/cruizba)\
**Post date:** [October 18, 2021, 1:45pm UTC](https://openvidu.discourse.group/t/websocket-wss-failed/3501/9 "2021-10-18T13:45:12Z")

</div>

If you’re using `openvidu-server-kms` docker image, this image is used only for **local development**

If you’re in a VPS and you want to deploy there OpenVidu with openvidu-classroom, please follow this deployment instructions first:

- **CE**
  - [AWS - OpenVidu Docs](https://docs.openvidu.io/en/stable/deployment/ce/aws/)
  - [On premises - OpenVidu Docs](https://docs.openvidu.io/en/stable/deployment/ce/on-premises/)

- **PRO/ENTERPRISE**
  - [AWS - OpenVidu Docs](https://docs.openvidu.io/en/stable/deployment/pro/aws/)
  - [On premises - OpenVidu Docs](https://docs.openvidu.io/en/stable/deployment/pro/on-premises/)

- **ENTERPRISE HIGH AVAILABILITY** :
  - [AWS - OpenVidu Docs](https://docs.openvidu.io/en/stable/deployment/enterprise/aws/)

Secondly, you can create your own image with your code following this:

- [openvidu-classroom - OpenVidu Docs](https://docs.openvidu.io/en/stable/demos/openvidu-classroom/#deploy-openvidu-classroom)

If you don’t want to create any docker image, you just need to run the classroom-demo at port 5442.

With the official deployment you will be able to access your app through `https://DOMAIN_OR_PUBLIC_IP/` (our nginx proxy will reverse proxy from 5442 to 443) and openvidu request will go through `https://DOMAIN_OR_PUBLIC_IP/openvidu` (our nginx proxy will reverse proxy from 5443 to 443).
