2.0.0 • Published 9 months ago

@warren-bank/browser-castv2 v2.0.0

Weekly downloads
-
License
GPL-2.0
Repository
github
Last release
9 months ago

browser-castv2

Browser build for node-castv2: An implementation of the Chromecast CASTV2 protocol

Build

npm install

# workaround for: "SyntaxError: Binding 'arguments' in strict mode."
#
# file:    ./node_modules/tls-browserify/index.js
# search:  function(arguments)
# replace: function()

npm run build

CDN

  <script src="//cdn.jsdelivr.net/npm/@warren-bank/browser-castv2@2.0.0/dist/es2020/castv2.js"></script>

Usage

  1. start the TCP proxy server

    • command-line:

        chromecast_ip='192.168.0.100'
        chromecast_port='8009'
        proxy_port='3000'
      
        ws-tcp-proxy "${chromecast_ip}:${chromecast_port}" --port "$proxy_port"
    • is a required workaround for the limitation that client-side javascript cannot make TCP socket connections

      • allows the client-side javascript to connect by websocket
      • pipes data from the websocket to the TCP socket
      • pipes data from the TCP socket to the websocket
  2. run the client-side javascript library in a web browser

Legal