Skip to content

Instantly share code, notes, and snippets.

@ChrisZou
ChrisZou / phoenix_channel_wechat_miniprogram_client_transport.js
Last active September 23, 2024 03:00
Phoenix Channel WeChat miniProgram client transport
//This is a WeChat miniprogram client transport for phoenix.js
// so that you can use easily use Phoenix Channel as a WebSocket server.
// Written by @chrismccord
// example usage:
// ```
// let socket = new Socket("ws://localhost:4000/socket", { transport: WxSocket })
// socket.connect()
// let channel = socket.channel("room:lobby", {})
// channel.join()
// .receive("ok", resp => { console.log("Joined successfully", resp) })