Your Eagle 3D Streaming Web SDK integration works when you double-click it. This is the next question: getting it onto a web address other people can open. Sometimes called hosting, sometimes serving — the same job either way.
file:// stops being good enoughOpening the page from disk works today, and it is the quickest way to see a stream. It is not something to build on, for two reasons:
Access-Control-Allow-Origin: *, which
accepts the null origin a file:// page has. That
is a server-side decision, and you would not be told if it changed.http:// is better found now than after you
have moved the files into your own application.The SDK is plain HTML, CSS and JavaScript. There is nothing to compile and no runtime it requires, so anything that can serve a static folder will work. What differs is what each option costs you.
| Option | Needs | Good for |
|---|---|---|
| Your own machine — nginx | a machine, a domain, a certificate | production, when you already have infrastructure |
| GitHub Pages — no machine needed | a free GitHub account | no server, no cost, a public URL in minutes |
| Your own machine — Node.js | a machine that runs Node | when you also want the token handled server-side |
| Your own machine — Windows IIS | Windows, already installed | a Windows machine you already run |
| Your own machine — Python, Node or PHP | nothing | a quick look, on your own machine only |
Two of these cost money or hardware — a server and a domain are not free. Two are free. One is for testing and should never face the public.
Any static file server. Run one of these in the folder and open
http://localhost:8000:
python -m http.server 8000 # Python 3
npx serve . # Node.js
php -S localhost:8000 # PHP
Nothing about your configuration changes. This is still serving, not
testing — testing is double-clicking the file, which needs no
server at all. This is the cheapest way to confirm the page behaves the same
over http:// as it did from disk.
If you already run a server, this is the smallest job on the page: copy the folder somewhere nginx can read, and add a server block pointing at it.
Put the SDK folder somewhere sensible, for example
/var/www/stream, so that index.html sits at
/var/www/stream/index.html. Then:
server {
listen 443 ssl;
server_name stream.yourdomain.com;
# Your certificate and its private key.
ssl_certificate /etc/ssl/certs/yourdomain.pem;
ssl_certificate_key /etc/ssl/private/yourdomain.key;
# The folder holding index.html, css/ and scripts/.
root /var/www/stream;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
# Send plain HTTP to HTTPS, so nobody reaches the page without a certificate.
server {
listen 80;
server_name stream.yourdomain.com;
return 301 https://$host$request_uri;
}
Reload nginx and open https://stream.yourdomain.com. There is no
application server, no Node process and nothing to keep running — nginx
is handing over files.
If you do not have a server and do not want one, GitHub will host a static folder for nothing and give you an address you can hand to anybody.
index.html is the top-level file./ (root), and save.
A minute later the page is live at
https://<your-account>.github.io/<repository>/, over
HTTPS, with a certificate handled for you. That URL is what you share.
The public Web SDK repository is served by GitHub Pages, from its own root, with nothing else involved. Both halves are open, so you can compare the files with the address they produce:
| The repository | github.com/e3ds/pixelstreaming-sdk |
| The page it serves | e3ds.github.io/pixelstreaming-sdk/ |
That address is public, permanent and shareable, and it cost nothing to
produce. It will not stream, though — the key in it is
the placeholder "Your Streaming API Key", because the real key is never published. It proves the hosting; filling in the key is what makes it
a stream, and the next section is how you do that without installing
anything.
You do not need git, an editor, or a checkout on your machine. Everything below happens on github.com.
scripts/sdk-config.js and press
the pencil icon — GitHub edits the file in the
browser.STREAMING_API_KEY, userName,
appName and configurationName.main and
/ (root), save.
A minute later your own copy is live at
https://<your-account>.github.io/pixelstreaming-sdk/,
streaming your application. Copy that URL and anyone you send it to
can open your stream — no account, no install, nothing to explain.
Node can serve the folder like anything else. A few lines with Express, or
npx serve behind a process manager, and you are done.
But if you are running Node anyway, do not use it only as a file server. You already have the one thing every other option on this page lacks: somewhere to put your API key that the browser cannot read.
This is why Node is worth the machine it costs when the alternatives are free: the other options serve files, and this one can also serve tokens.
Windows Server — and Windows itself, once the feature is enabled — ships with IIS, so a machine you already run can serve the folder with nothing extra installed.
Nothing needs configuring beyond that. There is no application pool setting that matters, because nothing runs server-side — IIS is serving static files.
Whichever you choose, the SDK does not require the page to be served from an
Eagle 3D Streaming domain. The demo is the proof: it runs on
eaglepixelstreaming.com and streams from
connector.eagle3dstreaming.com — two different origins. Your
page can live on your own domain, behind your own login.
Last updated