Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

phoenix-channels

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phoenix-channels

Phoenix Channels Client

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
increased by0.86%
Maintainers
1
Weekly downloads
 
Created
Source

Phoenix Channels Client

This is the Node.js client. If you need a client for the browser use phoenix

The differece with the original client is that this does not use long-polling and you need to pass the absolute url instead of the relative url.

Usage

This uses the same API as the original phoenix except that it needs an absolute url

const { Socket } = require('phoenix-channels')

let socket = new Socket("ws://example.com/socket")

socket.connect()

// Now that you are connected, you can join channels with a topic:
let channel = socket.channel("room:lobby", {})
channel.join()
  .receive("ok", resp => { console.log("Joined successfully", resp) })
  .receive("error", resp => { console.log("Unable to join", resp) })

Presence is also available

Installation

npm install --save phoenix-channels

Authors

API was made by authors of the Phoenix Framework

  • see their website for complete list of authors.

Ported to Node.js by Mario Campa

License

The same as Phoenix Framework (MIT)

FAQs

Package last updated on 30 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc