Skip to content

Instantly share code, notes, and snippets.

@chunhunghan
Last active June 28, 2019 03:29
Show Gist options
  • Select an option

  • Save chunhunghan/d0ac833a6f4f61dd522c8997d8e4f581 to your computer and use it in GitHub Desktop.

Select an option

Save chunhunghan/d0ac833a6f4f61dd522c8997d8e4f581 to your computer and use it in GitHub Desktop.
Flutter : WebSocket connect with headers https://qiita.com/n-luan/items/e81870598e7598ee415b
channel = new IOWebSocketChannel.connect(socketUrl, headers: {
"UID": auth.uid,
"ACCESS_TOKEN": auth.accessToken,
"CLIENT_ID": auth.clientId
});
channel.sink.add(json.encode({
"command": "subscribe",
"identifier": "{\"channel\":\"RoomChannel\"}"
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment