Jump to content
  • 0

Why I am getting Websocket Error in Web RTc Conference?


Ragesh Antony
 Share

Question

I trying AntMedia EE trial

I am using the WebRTC demo located in https://ant.techrova.in/LiveApp/conference.html

(The inbuilt demo)

The join room is disabled and I check the console

enter image description here

I m getting these error

WebSocket connection to 'wss://
' failed: Error during WebSocket handshake: Unexpected response code: 404

dont know how to fix it ?

This is my apache proxy config

for http

<VirtualHost *:80>        ServerName ant.techrova.in        ProxyPreserveHost On        ProxyPass / http://127.0.0.1:5080/        ProxyPassReverse / http://127.0.0.1:5080/        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,        # error, crit, alert, emerg.        # It is also possible to configure the loglevel for particular        # modules, e.g.        #LogLevel info ssl:warn        ErrorLog ${APACHE_LOG_DIR}/error.log        CustomLog ${APACHE_LOG_DIR}/access.log combinedRewriteEngine onRewriteCond %{SERVER_NAME} =ant.techrova.inRewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]</VirtualHost>

for https

<IfModule mod_ssl.c><VirtualHost *:443>        ServerName ant.techrova.in        ProxyPreserveHost On        ProxyPass / http://127.0.0.1:5080/        ProxyPassReverse / http://127.0.0.1:5080/        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,        # error, crit, alert, emerg.        # It is also possible to configure the loglevel for particular        # modules, e.g.        #LogLevel info ssl:warn        ErrorLog ${APACHE_LOG_DIR}/error.log        CustomLog ${APACHE_LOG_DIR}/access.log combinedSSLCertificateFile /etc/letsencrypt/live/ant.techrova.in/fullchain.pemSSLCertificateKeyFile /etc/letsencrypt/live/ant.techrova.in/privkey.pemInclude /etc/letsencrypt/options-ssl-apache.conf</VirtualHost></IfModule>

====================

Please help to resolve this issue

Link to comment
Share on other sites

  • Answers 4
  • Created
  • Last Reply

Top Posters For This Question

4 answers to this question

Recommended Posts

  • 0
Hi,

Have a good day. 


Please enable the following modules:

a2enmod proxy proxy_http proxy_wstunnel

Add the following lines in your conf file.

RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:5080/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://localhost:5080/$1 [P,L]
ProxyPass / http://localhost:5080/
ProxyPassReverse / http://localhost:5080/


After that restart the apache2 services as below:

systemctl restart apache2

Best Regards,

Selim

On Saturday, May 30, 2020 at 11:42:04 PM UTC+3, Ragesh Antony wrote:

I trying AntMedia EE trial

I am using the WebRTC demo located in https://ant.techrova.in/LiveApp/conference.html

(The inbuilt demo)

The join room is disabled and I check the console

enter image description here

I m getting these error

WebSocket connection to 'wss://
' failed: Error during WebSocket handshake: Unexpected response code: 404

dont know how to fix it ?

This is my apache proxy config

for http

<VirtualHost *:80>        ServerName ant.techrova.in        ProxyPreserveHost On        ProxyPass / http://127.0.0.1:5080/        ProxyPassReverse / http://127.0.0.1:5080/        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,        # error, crit, alert, emerg.        # It is also possible to configure the loglevel for particular        # modules, e.g.        #LogLevel info ssl:warn        ErrorLog ${APACHE_LOG_DIR}/error.log        CustomLog ${APACHE_LOG_DIR}/access.log combinedRewriteEngine onRewriteCond %{SERVER_NAME} =ant.techrova.inRewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]</VirtualHost>

for https

<IfModule mod_ssl.c><VirtualHost *:443>        ServerName ant.techrova.in        ProxyPreserveHost On        ProxyPass / http://127.0.0.1:5080/        ProxyPassReverse / http://127.0.0.1:5080/        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,        # error, crit, alert, emerg.        # It is also possible to configure the loglevel for particular        # modules, e.g.        #LogLevel info ssl:warn        ErrorLog ${APACHE_LOG_DIR}/error.log        CustomLog ${APACHE_LOG_DIR}/access.log combinedSSLCertificateFile /etc/letsencrypt/live/ant.techrova.in/fullchain.pemSSLCertificateKeyFile /etc/letsencrypt/live/ant.techrova.in/privkey.pemInclude /etc/letsencrypt/options-ssl-apache.conf</VirtualHost></IfModule>

====================

Please help to resolve this issue

Link to comment
Share on other sites

  • 0
Hi Ragesh

I changed some definitions in Apache reverse proxy and web socket configs. Please try as below.

RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:5080/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://localhost:5080/$1 [P,L]
ProxyPass / http://localhost:5080/
ProxyPassReverse / http://localhost:5080/


 It worked in our test instance. ​I hope it helps.


On Saturday, May 30, 2020 at 11:42:04 PM UTC+3, Ragesh Antony wrote:

I trying AntMedia EE trial

I am using the WebRTC demo located in https://ant.techrova.in/LiveApp/conference.html

(The inbuilt demo)

The join room is disabled and I check the console

enter image description here

I m getting these error

WebSocket connection to 'wss://
' failed: Error during WebSocket handshake: Unexpected response code: 404

dont know how to fix it ?

This is my apache proxy config

for http

<VirtualHost *:80>        ServerName ant.techrova.in        ProxyPreserveHost On        ProxyPass / http://127.0.0.1:5080/        ProxyPassReverse / http://127.0.0.1:5080/        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,        # error, crit, alert, emerg.        # It is also possible to configure the loglevel for particular        # modules, e.g.        #LogLevel info ssl:warn        ErrorLog ${APACHE_LOG_DIR}/error.log        CustomLog ${APACHE_LOG_DIR}/access.log combinedRewriteEngine onRewriteCond %{SERVER_NAME} =ant.techrova.inRewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]</VirtualHost>

for https

<IfModule mod_ssl.c><VirtualHost *:443>        ServerName ant.techrova.in        ProxyPreserveHost On        ProxyPass / http://127.0.0.1:5080/        ProxyPassReverse / http://127.0.0.1:5080/        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,        # error, crit, alert, emerg.        # It is also possible to configure the loglevel for particular        # modules, e.g.        #LogLevel info ssl:warn        ErrorLog ${APACHE_LOG_DIR}/error.log        CustomLog ${APACHE_LOG_DIR}/access.log combinedSSLCertificateFile /etc/letsencrypt/live/ant.techrova.in/fullchain.pemSSLCertificateKeyFile /etc/letsencrypt/live/ant.techrova.in/privkey.pemInclude /etc/letsencrypt/options-ssl-apache.conf</VirtualHost></IfModule>

====================

Please help to resolve this issue

Link to comment
Share on other sites

  • 0
Hi Ragesh,

Could you please check your UDP Ports(5000-65000)? 


Best Regards,
Selim.

On Monday, June 1, 2020 at 11:37:17 AM UTC+3, Selim Emre wrote:
Hi Ragesh

I changed some definitions in Apache reverse proxy and web socket configs. Please try as below.

RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:5080/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://localhost:5080/$1 [P,L]
ProxyPass / http://localhost:5080/
ProxyPassReverse / http://localhost:5080/


 It worked in our test instance. ​I hope it helps.


On Saturday, May 30, 2020 at 11:42:04 PM UTC+3, Ragesh Antony wrote:

I trying AntMedia EE trial

I am using the WebRTC demo located in https://ant.techrova.in/LiveApp/conference.html

(The inbuilt demo)

The join room is disabled and I check the console

enter image description here

I m getting these error

WebSocket connection to 'wss://
' failed: Error during WebSocket handshake: Unexpected response code: 404

dont know how to fix it ?

This is my apache proxy config

for http

<VirtualHost *:80>        ServerName ant.techrova.in        ProxyPreserveHost On        ProxyPass / http://127.0.0.1:5080/        ProxyPassReverse / http://127.0.0.1:5080/        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,        # error, crit, alert, emerg.        # It is also possible to configure the loglevel for particular        # modules, e.g.        #LogLevel info ssl:warn        ErrorLog ${APACHE_LOG_DIR}/error.log        CustomLog ${APACHE_LOG_DIR}/access.log combinedRewriteEngine onRewriteCond %{SERVER_NAME} =ant.techrova.inRewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]</VirtualHost>

for https

<IfModule mod_ssl.c><VirtualHost *:443>        ServerName ant.techrova.in        ProxyPreserveHost On        ProxyPass / http://127.0.0.1:5080/        ProxyPassReverse / http://127.0.0.1:5080/        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,        # error, crit, alert, emerg.        # It is also possible to configure the loglevel for particular        # modules, e.g.        #LogLevel info ssl:warn        ErrorLog ${APACHE_LOG_DIR}/error.log        CustomLog ${APACHE_LOG_DIR}/access.log combinedSSLCertificateFile /etc/letsencrypt/live/ant.techrova.in/fullchain.pemSSLCertificateKeyFile /etc/letsencrypt/live/ant.techrova.in/privkey.pemInclude /etc/letsencrypt/options-ssl-apache.conf</VirtualHost></IfModule>

====================

Please help to resolve this issue

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...