Cant connect to openvidu wss

Hi im using Ubuntu 18.04 server and ive followed steps from your deploying on Ubuntu tutorial.
So ive tried local and it works fine but ive got problems when i try connect remotely.

Ive got error in Openvidu logs`
“[ERROR] 2020-04-23 12:48:38,473 [0.0-4443-exec-1] org.springframework.web.socket.server.support.DefaultHandshakeHandler - Handshake failed due to invalid Upgrade header: null”

and in browser console as well`
“Firefox can’t establish a connection to the server at wss://my_domain/sockjs-node.” and in chrome too.
And ive tried to test connection, with entering my_domain and entering OpenVidu username and mySecret, but wss connection failed there too.

Can you help me please, why i cant connect to Openvidu wss?

Can you describe how are you trying to connect to OpenVidu? wss://my_domain/sockjs-node is not a valid URL in OpenVidu platform. It this URL belonging to your app? In that case, is the problem with your app?

Can you share a screenshare with the browser error? showing browser console?

Thanks for replying.
This is screenshot of console of my firefox browser

And got this error on my openvidu console

[ERROR] 2020-04-23 12:48:38,473 [0.0-4443-exec-1] org.springframework.web.socket.server.support.DefaultHandshakeHandler - Handshake failed due to invalid Upgrade header: null

This message is usually visible when there’s some kind of proxy miss-configured in front of the Spring App offering a websocket endpoint (in this case OpenVidu Server). Or maybe you have a problem with the certificate.

We could try to help you solve your issue in your current installation attempt, but as we released 2.13.0 version yesterday in the evening (version which brings a totally new and easy way to deploy OpenVidu, including using a valid certificate), I recommend you try installing 2.13.0 and get back here if you have any other problem or doubt.

Regards.

So ive done as you said.
I follow steps for deploying openvidu 2.13.0
But actually ive got same error when i try to test wss connection

Where have you deployed OPenVidu? Have you done it using a valid domain?

If not, then you must accept your invalid certificate. There must be something wrong with either your configuration or your domain/certficiate. Please, go through your .env file, and if you want you can paste it here to get further help.

Regards.

I’m also struggling with websockets after deploying using the AWS walkthrough. I can connect to my server using SSL and the openvidu-call app functions perfectly, but I can’t connect to the websocket from an external app.

Strangely enough my external app’s REST API calls work, so I am creating a session and retrieving a token. Am I just missing something dumb?

here is my url if you’d like to try it out https://test.cl3v3r.club

I tested your app and it is working.

My client app that I copied onto the same AWS server, and then inside of the nginx container is working. After figuring that out I suppose that fulfills my needs, and isn’t the scariest deployment strat I have performed-- but I was originally trying to host the client on a different server and use the AWS deployment as an external API.

That was the case where my websocket was not connecting. I feel like I am either being dumb or there is a nuance with docker and nginx that isn’t connecting-- since some of those behaviors seemed to out date the docs.

Not super important, but I thought I would clarify :sweat_smile: I am really enjoying playing with this stuff!

We have used the platform for other server without issues. I don’t know what can be the reason is not working for you.

So Ive tried to change CERTIFICATE_TYPE = to selfsigned or letsencrypt but result is the same.

There are same logs in OpenVidu Server

openvidu-server_1  | [INFO] 2020-04-30 12:40:56,744 [0.0-5443-exec-2] io.openvidu.server.config.HttpHandshakeInterceptor - Old HttpSession B96779F1526AC4F5D77EF6F932EF1CCD
openvidu-server_1  | [ERROR] 2020-04-30 12:40:56,745 [0.0-5443-exec-2] org.springframework.web.socket.server.support.DefaultHandshakeHandler - Handshake failed due to invalid Upgrade header: null

Here is my .env file

# OpenVidu configuration
# ----------------------
# Documentation: https://docs.openvidu.io/en/stable/reference-docs/openvidu-config/

# NOTE: This file doesn't need to quote assignment values, like most shells do.
# All values are stored as-is, even if they contain spaces, so don't quote them.

# Domain name. If you do not have one, the public IP of the machine.
# For example: 198.51.100.1, or openvidu.example.com
OPENVIDU_DOMAIN_OR_PUBLIC_IP=livenowmedia.pw

# OpenVidu SECRET used for apps to connect to OpenVidu server and users to access to OpenVidu Dashboard
OPENVIDU_SECRET=MY_SECRET

# Certificate type:
# - selfsigned:  Self signed certificate. Not recommended for production use.
#                Users will see an ERROR when connected to web page.
# - owncert:     Valid certificate purchased in a Internet services company.
#                Please put the certificates files inside folder ./owncert
#                with names certificate.key and certificate.cert
# - letsencrypt: Generate a new certificate using letsencrypt. Please set the
#                required contact email for Let's Encrypt in LETSENCRYPT_EMAIL
#                variable.
CERTIFICATE_TYPE=selfsigned

# If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for notifications
LETSENCRYPT_EMAIL=hayk1998@mail.ru

# Whether to enable recording module or not
OPENVIDU_RECORDING=true

# Openvidu Folder Record used for save the openvidu recording videos. Change it
# with the folder you want to use from your host.
OPENVIDU_RECORDING_PATH=/opt/openvidu/recordings

# System path where OpenVidu Server should look for custom recording layouts
OPENVIDU_RECORDING_CUSTOM_LAYOUT=/opt/openvidu/custom-layout

# if true any client can connect to
# https://OPENVIDU_SERVER_IP:OPENVIDU_PORT/recordings/any_session_file.mp4
# and access any recorded video file. If false this path will be secured with
# OPENVIDU_SECRET param just as OpenVidu Server dashboard at
# https://OPENVIDU_SERVER_IP:OPENVIDU_PORT
# Values: true | false
OPENVIDU_RECORDING_PUBLIC_ACCESS=true

# Which users should receive the recording events in the client side
# (recordingStarted, recordingStopped). Can be all (every user connected to
# the session), publisher_moderator (users with role 'PUBLISHER' or
# 'MODERATOR'), moderator (only users with role 'MODERATOR') or none
# (no user will receive these events)
OPENVIDU_RECORDING_NOTIFICATION=publisher_moderator

# Timeout in seconds for recordings to automatically stop (and the session involved to be closed)
# when conditions are met: a session recording is started but no user is publishing to it or a session
# is being recorded and last user disconnects. If a user publishes within the timeout in either case,
# the automatic stop of the recording is cancelled
# 0 means no timeout
OPENVIDU_RECORDING_AUTOSTOP_TIMEOUT=120

# Maximum video bandwidth sent from clients to OpenVidu Server, in kbps.
# 0 means unconstrained
OPENVIDU_STREAMS_VIDEO_MAX_RECV_BANDWIDTH=1000

# Minimum video bandwidth sent from clients to OpenVidu Server, in kbps.
# 0 means unconstrained
OPENVIDU_STREAMS_VIDEO_MIN_RECV_BANDWIDTH=300

OPENVIDU_STREAMS_VIDEO_MAX_SEND_BANDWIDTH=1000

# Minimum video bandwidth sent from OpenVidu Server to clients, in kbps.
# 0 means unconstrained
OPENVIDU_STREAMS_VIDEO_MIN_SEND_BANDWIDTH=300

# true to enable OpenVidu Webhook service. false' otherwise
# Values: true | false
OPENVIDU_WEBHOOK=false

# HTTP endpoint where OpenVidu Server will send Webhook HTTP POST messages
# Must be a valid URL: http(s)://ENDPOINT
#OPENVIDU_WEBHOOK_ENDPOINT=

# List of headers that OpenVidu Webhook service will attach to HTTP POST messages
#OPENVIDU_WEBHOOK_HEADERS=

# List of events that will be sent by OpenVidu Webhook service
# Leave blank if all events.
OPENVIDU_WEBHOOK_EVENTS=[sessionCreated,sessionDestroyed,participantJoined,participantLeft,webrtcConnectionCreated,webrtcConnectionDestroyed,recordingStatusChanged,filterEventDispatched,mediaNodeStatusChanged]

OPENVIDU_SESSIONS_GARBAGE_INTERVAL=900

# Minimum time in seconds that a non active session must have been in existence
# for the garbage collector of non active sessions to remove it. Default to 3600s (1 hour).
# If non active sessions garbage collector is disabled
# (property 'OPENVIDU_SESSIONS_GARBAGE_INTERVAL' to 0) this property is ignored
OPENVIDU_SESSIONS_GARBAGE_THRESHOLD=3600

# Call Detail Record enabled
# Whether to enable Call Detail Record or not
# Values: true | false
OPENVIDU_CDR=false

# Path where the cdr log files are hosted
OPENVIDU_CDR_PATH=/opt/openvidu/cdr

# Kurento Media Server image
# --------------------------
# Docker hub kurento media server: https://hub.docker.com/r/kurento/kurento-media-server-dev
# KMS_IMAGE=kurento/kurento-media-server-dev:6.13                                                                                                                                                                  
# Kurento Media Server Level logs
# -------------------------------
# Uncomment the next line and define this variable to change
# the verbosity level of the logs of KMS
# Documentation: https://doc-kurento.readthedocs.io/en/stable/features/logging.html
# KMS_DEBUG_LEVEL=3,Kurento*:4,kms*:4,sdp*:4,webrtc*:4,*rtpendpoint:4,rtp*handler:4,rtpsynchronizer:4,agnosticbin:4

# Openvidu Server Level logs
# --------------------------
# Uncomment the next line and define this variable to change
# the verbosity level of the logs of Openvidu Service
# RECOMENDED VALUES: INFO for normal logs DEBUG for more verbose logs
# OV_CE_DEBUG_LEVEL=INFO

# Java Options
# --------------------------
# Uncomment the next line and define this to add
# options to java command
# Documentation: https://docs.oracle.com/cd/E37116_01/install.111210/e23737/configuring_jvm.htm#OUDIG00058
# JAVA_OPTIONS=-Xms2048m -Xmx4096m

Ill be glad if you could help me finish this.

Please execute the following commands and share with us the results:

sudo su
cd /opt/openvidu
docker-compose logs openvidu-server
docker-compose logs nginx
cat .env