Serving the page

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.

Why file:// stops being good enough

Opening 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:

Choosing how to serve it

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.

OptionNeedsGood 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.


Serving from your own machine — Python, Node or PHP

Free, nothing to install, one command

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.

Serving from your own machine — nginx

Costs a machine, a domain and a certificate

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.

Hosting on GitHub Pages — no machine of your own

Free, and you get a public URL

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.

  1. Create a repository on GitHub — public is fine, and free.
  2. Put the SDK folder's contents at the repository root, so index.html is the top-level file.
  3. Push it.
  4. In the repository, open Settings → Pages.
  5. Set the source to your branch and / (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 SDK is hosted exactly this way — here it is

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:

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.

The whole thing in a browser: fork it, edit, share

You do not need git, an editor, or a checkout on your machine. Everything below happens on github.com.

  1. Open github.com/e3ds/pixelstreaming-sdk and press Fork. You now have your own copy.
  2. In your fork, open scripts/sdk-config.js and press the pencil icon — GitHub edits the file in the browser.
  3. Fill in the four values that are placeholders: STREAMING_API_KEY, userName, appName and configurationName.
  4. Press Commit changes. That is the save.
  5. Settings → Pages, source 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.

Serving from your own machine — Node.js

Costs a machine, and it is the only option that also solves the key problem

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.

Serving from your own machine — Windows IIS

Already on the machine, nothing to buy

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.

  1. Enable Internet Information Services in Windows Features if it is not on already.
  2. Open IIS Manager.
  3. Add a website: give it a name, point its physical path at the SDK folder, and choose a port or host name.
  4. For HTTPS, bind a certificate to the site in the same dialog.

Nothing needs configuring beyond that. There is no application pool setting that matters, because nothing runs server-side — IIS is serving static files.


Your own domain is not a problem

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