Remote Access

Access your Streamer.bot instance from other devices

When interacting with the Streamer.bot WebSocket Server, you may want to access your instance from other devices, such as your phone or another computer.

Depending on your use case, there are a few different ways to achieve this.

Local Area Network (LAN)

You can access your Streamer.bot instance over your local network by simply using the local IP address of the machine running Streamer.bot.

Configuration

By default, Streamer.bot's WebSocket server only listens to connections from localhost (i.e. the same machine).

To allow connections from other devices on your local network, you need to change the Address setting in the WebSocket settings.

You can listen to only LAN devices by setting Address to your LAN IP address, or you can simply listen on all adapters by setting Address to 0.0.0.0

Example

For example, if you have an HTML/Javascript overlay utilizing the Streamer.bot Client, you would change the host property to the local IP address of the machine running Streamer.bot.

const client = new StreamerbotClient({
  host: '192.168.1.10' // Replace with your local IP address
});

Mixed Content Restrictions

If you try to interact with the Streamer.bot WebSocket server via a web page hosted from https://, most web browsers will block ws:// connections to any non-localhost address due to mixed content restrictions.

There are a few ways to get around this:

  • Secure You can use the other remote access methods below to securely connect via wss://
  • Insecure You can use the --allow-running-insecure-content flag in Chromium based browsers
    • Note This flag will also work for OBS Studio and allow connections from any browser sources or docks, such as Streamer.bot Chat
  • Insecure You can host your web page via http:// instead of https://

Virtual Private Network (VPN)

A VPN allows you to securely connect to your home network from anywhere in the world.

Tailscale

Tailscale is a VPN based on WireGuard that makes it easy to securely communicate between your devices.

Install Tailscale

  1. Follow the installation instructions to install Tailscale on the machine running Streamer.bot and any other devices you want to connect from.
  2. Log in to Tailscale using your preferred authentication method.
  3. Ensure that the devices are connected and can see each other in the Tailscale admin console.

Configure Tailscale Serve

Tailscale Serve requires HTTPS certificates to be enabled on your tailnet.
You can ensure this option is enabled in your Tailnet DNS Settings

To serve your Streamer.bot WebSocket Server to all devices on your tailnet, we can use Tailscale Serve.

This will createa secure wss:// endpoint that you can use to connect to your Streamer.bot instance from any devices on your tailnet.

Refer to the Tailscale Serve documentation for more information.

Execute Tailscale Serve via Command Line

Replace 8080 with the port your Streamer.bot WebSocket server is running on. By default, this is 8080
Terminal
tailscale serve 8080

Execute Tailscale Serve via Streamer.bot

Alternatively, we can use the Run a Program sub-action to execute the command directly from Streamer.bot, allowing use of triggers to start Tailscale Serve when certain events happen.

For example, if you add the Streamer.bot Started trigger to your action, Tailscale Serve will automatically start whenever Streamer.bot starts up!

Configure Run a Program sub-action to execute tailscale serve

Configure Run a Program sub-action to execute tailscale serve


You should see a command line window open, with the URL to access your Streamer.bot WebSocket server via Tailscale Serve.

Connect to Streamer.bot

You can now connect to your Streamer.bot instance from any device on your tailnet using the URL provided by Tailscale Serve.

Because Tailscale Serve uses HTTPS, the port you use to connect will always be 443 and you will need to use wss:// scheme.

Examples

const client = new StreamerbotClient({
  host: 'device.my-tailnet.ts.net',
  port: 443,
  scheme: 'wss'
});

Secure Tunnel

Tunneling services allow you to expose your local Streamer.bot instance to the internet securely.

Cloudflare Tunnel

Cloudflare Tunnel allows you to securely expose your local servers to the internet.

ngrok

ngrok is a popular tool to expose local servers to the internet.

Tailscale Funnel

Tailscale Funnel allows you to expose local servers to the internet using Tailscale.