Squawk is a realtime broadcast which includes important headlines, price movement and rumors as stories develop to give traders and investors news in the fastest and most convenient form.”
UUID
string used to coordinate messages between client and server over WebSocket.
Response
appended at the end of the message’s type sent. For e.g. a message with type joinRoom
will receive a response with type joinRoomResponse
apikey
.
sub
of JWT, to identify each user.
Please refer to https://github.com/Benzinga/jwt for more information on Benzinga JWT token. For JWT, you will need to share the hosting location/endpoint of your public key to Benzinga from where our authenticator service would be able to download the public key using key ID. At the moment this is a manual one time process.
On successful authentication and connection, you should get the following response:
iceServers
details, authentication is done. Next, send the join room request/message. The room name for benzinga broadcasts is PRO
. Sample join room request format:
existingPresenters
represents active broadcasters at the moment.
existingPresenters
received in joinRoom
’s response as participants in the room and create a peer connection with each of the presenters to start listening to them. To create a peer connection, send the SDP offer for each participant/presenter through receiveMedia
request. Please note that the SDP offer should only contain audio attributes (no video attributes) and it should be a receive-only (a=recvonly
). Meaning you won’t be able to send anything and will receive audio-only from squawk.
Sample receiveMedia
(SDP offer) for peer connection will look like as below:
userid
is the one from existingPresenters
. On successful negotiation, you should get following SDP answer with the same id:
iceCandidate
from each participant’s peer:
newPresenterArrived
message will be as follow:
userId
, you can map the iceCandidate
to the existing broadcaster/participant.
userId
in the message. Typical presenterLeft
message will be received in below format:
mediaOverride
message will be in the following format:
ping
messages to keep the Web Socket connection alive. Every 25-30 seconds should be good enough. Ping request format:
id
:
rtp-receiver
example. 5 open ports are more than enough.
apikey
.
PRO
. Sample join room request format:
existingPresenters
represents active broadcasters at the moment. So if there are any existing broadcasters, you should start SDP negotiation with each broadcaster to receive the audio stream.
userId
received in a presenter object. Sample format as shown below:
8449
. Also when broadcaster left and the streaming session ends, you should return the used IP back to pool fr next time use.
On successful negotiation you should get below response:
sdpAnswer
can be useful if you are aiming to re-broadcast the stream via WebRTC through any media server on your end. If not then simply ignore that. At this point, after successful SDP negotiation, you should start receiving RTP audio stream from Squawk.
presenterLeft
message will be received in below format:
ping
messages to keep the Web Socket connection alive. Every 25-30 seconds should be good enough. Ping request format: