This project will connect to the Twitter API streaming endpoint
for the configured application and provide an authenticated web
socket connection to relay the stream to one or more downstream
consumers (see @guahanweb/twitter-relay-consumer
).
NOTE: this project is not intended for broad usage and is only designed as a case study for a workshop during All Things Open 2022.
The following environment variables may be set to adjust behavior:
BEARER_TOKEN
- REQUIRED: your Twitter API tokenAUTH_TOKEN
- an authorization header string on which to match inbound upgrade requests (defaults totesting
)HOST
- the host name on which to listen (defaults tolocalhost
)PORT
- the port on which to listen (defaults to3000
)LOG_LEVEL
- reporting level for logs (defaults todebug
)
In order to connect to your relay service, your consumer must provide
a bearer token authorization header for the upgrade request. This token
must be the base64 encoded version of your AUTH_TOKEN
option.
Example:
POST /connect
Authorization bearer <base64:testing>