By aforum
Hello, I followed a tutorial to install spreed-webrtc-snap on VPS linux 18.04 https://www.fosslinux.com/45051/how-to-install-spreed-webrtc-server-on-ubuntu.htm
This tutorial did not really treat the HTTPS part.
I have a subdomain, with a valid let’s encrypt certificate. Spreed WebRTC running on 8443 port, and coturn server on 8444 port.
Here is the vhost config file
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName sub.domain.com
SSLEngine on
SSLStrictSNIVHostCheck Off
SSLProxyEngine On
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerName Off
SSLProxyVerify none
<Location />
ProxyPass https://127.0.0.1:8443/
ProxyPassReverse https://127.0.0.1:8443/
</Location>
<Location /ws>
ProxyPass wss://127.0.0.1:8443/
</Location>
ProxyVia On
ProxyPreserveHost On
#RequestHeader set X-Forwarded-Proto 'https' env=HTTPS
SSLCertificateFile /etc/letsencrypt/live/sub.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/sub.domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
After I made some modifications; here is the result:
1) Accessing by web address when I enter https://sub.domain.com, the UI loads (not completely), because of this error that displays in browser console.
websocket connection to wss://sub.domaine.com/ws failed
2) Accessing by ip address When I enter IP as https://ip_address:8443, there is two cases; a) Kaspersky running Kaspersky prompts me if I want to continue to the dangerous website (this is normal cause there is no certificate for ip address), I click yes. Kaspersky generates its own certificate (I guess), then, the UI loads completely and the spreed webrtc works really great, I was able to make video call between 2 computers. b) Kaspersky not running This time, it’s the web browser that asks me if I want to continue to dangerous site, when I click yes, the UI do not load completely and I receive the same error on console when I access by web address
websocket connection to wss://ip_address:8443/ws failed
The goal is that webrtc runs when accessing it by web address, I do not understand the problem.
Any help? Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
I don’t know the exact issue but here are some suggestions on how to resolve it.
The Apache proxy is properly configured to handle WebSocket connections. You have already made the configurations for that, but you might need to verify if those are working correctly.
When accessing via domain name, the WebSocket connection must be secure (wss://) since your site is served over HTTPS.
When troubleshooting, consider reviewing Apache error logs and access logs which might give you more insights about what’s going wrong.
You can access Apache logs generally at:
/var/log/apache2/error.log
/var/log/apache2/access.log
Check if Spreed WebRTC has configurations related to WebSockets and domains and ensure that those are correctly set to your domain.
You might need to modify the SSL Proxy configurations in your Apache config:
<Location />
ProxyPass https://127.0.0.1:8443/
ProxyPassReverse https://127.0.0.1:8443/
ProxyPassReverseCookieDomain 127.0.0.1 sub.domain.com
</Location>
<Location /ws>
ProxyPass wss://127.0.0.1:8443/ws
</Location>
WebSocket Proxy Module:
Make sure that you have the necessary Apache WebSocket proxy module enabled:
sudo a2enmod proxy_wstunnel
sudo systemctl restart apache2
After performing these steps, try accessing your service again via the subdomain and inspect the console for any errors. If you still encounter issues, the specific errors in your logs or console will be crucial for further troubleshooting.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.