Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How would you go about making this accessible over the internet? #15

Closed
creepandpeep opened this issue Jan 29, 2017 · 6 comments
Closed
Labels

Comments

@creepandpeep
Copy link

Stream is working perfectly on local network - if I wanted to make it accessible over the internet, I take it forwarding ports on a router isn't going to cut it for this?

@waveform80
Copy link
Owner

It'll need a little more than that, but not much since it's just using TCP for everything. Firstly you'll need to forward two ports: 8082 for the HTTP connection, and 8084 for the WS connection. Secondly you'll need to tweak the code a bit so that the URL for the WS connection points to the router's external IP rather than the Pi's address...

If you look at index.html you'll see ws://${ADDRESS}/ somewhere in there. That's the URL for the video stream. ADDRESS is substituted in do_GET (in server.py) for the socket's own address (see getsockname). But that'll be internal to the LAN the Pi is on. You could simply hard-code that as your external address (or hostname - it doesn't have to be an IP), or you could do something a bit more nuanced to try and calculate your external address (e.g. Google "what's my IP?").

Anyway, I think that should be enough to get it working over the internet. As to how secure the code is ... no idea. I haven't put any thought into security on this; nothing's encrypted, there's no authentication, and the error checking is minimal.

@creepandpeep
Copy link
Author

creepandpeep commented Jan 30, 2017 via email

@creepandpeep
Copy link
Author

That's done it, replacing the address variable with hardcoded domain name and ports forwarded. got a friend to test remotely and the quality/speed is apparently fantastic.

Thanks again!

@waveform80
Copy link
Owner

Great stuff! Glad to see it's a simple as I thought. Don't know about the quality being great - this is only MPEG1 - but it's good enough for a demo.

The display-o-tron is something I need to have a play with (had one sitting in a drawer for a while). However, I did throw something together for pimoroni's pantilthat recently (if you've got one, checkout the pantilthat branch on this repo :). Anyway, have fun!

@creepandpeep
Copy link
Author

well, 640x480 picture was apparently very smooth and very fast - speaking with a friend on the phone and my lips were syncd to my voice. I realise this is only one person connecting in, but over a home broadband connection which I later realised was also uploading a huge file via torrent at the same time, it was fantastic.

@creepandpeep
Copy link
Author

  • and you should definitely play with the displayotron, it's great! Accidentally ordered 2, ended up buying another pi to use them both at the same time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants