Jaime,
I’m sorry the demo is not working for you. I just tried, I am getting 9s latency (left is real time from the camera, and the right is watching my stream):
My instance is running in Ireland, so perhaps there is excessive latency due to distance. Can you paste the error message from the status box and send it to me via private message?
Try the livestream demo on api.video. The code is basically the same, but we have this version load balanced and running in both Canada and France.
You can also spin up your own version (if you run it on localhost, there is no HTTPS requirement) https://github.com/dougsillars/browserLiveStream - so you wont have any latency issues :). I think the documentation walks through the setup pretty well, but if you have questions, let me know.
On to the port question:
- Port 443 is required for the browser connection to the website. Why? HTTPS is secure, so you should do this anyway. But - Chrome and Firefox (and maybe Safari too, I don’t recall) all require HTTPS to access the camera/microphone API.
You are correct though, the service is running on port 1437, on an Amazon server in Ireland. (and directly to this server, I have the port opened):
http://ec2-52-49-92-103.eu-west-1.compute.amazonaws.com:1437/
But, adding ports to the end of urls is hard for people to type, so generally, we want the url to not have the port number. The default HTTP port is 80, so on my server, I have a reverse proxy set to redirect all traffic from port 80 to port 1437:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name localhost;
root /usr/share/nginx/html;
location / {
proxy_pass http://127.0.0.1:1437;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
anything that reaches http://ec2-52-49-92-103.eu-west-1.compute.amazonaws.com is seamlessly redirected to port 1437. if you open this link, you’ll see it works without the port. (Google Reverse proxy to find out how to do this, I used NGINX on Ubuntu).
Ok, so how do I get HTTPS (port 443) running on this site? You cannot add a cert to an AWS EC2 instance - they are too transient. BUT, you can place a HTTPS certificate on a load balancer, and then push the traffic from the load balancer to the EC2 instance.
So, I have added a load balancer that balances zero load (there is just one server). However, It does have a certificate (to provide the HTTPS), and then routes the traffic to port 80 on the EC2 server.
So, step by step:
- user types http://livestream.streamclarity.com/
- DNS lookup sends it to the load balancer.
- load balancer forces the connection to HTTPS (port 443), and then sends the traffic to the EC2 instance.
- EC2 instance takes all traffic and routes it to port 1437.