A quick, secure, and temporary channel to share secrets. Create an ephemeral room and send the link. Your browser is the host and the person with the link can see what you enter only while your browser keeps the room open.
Running in development
Start the server
- Create a
.envfile, following the variables in.env.template - Install dependencies with
yarn install - Start the server with
yarn dev
Run the client in development mode
- Create a
.envfile, following the variables inclient/.env.template - Start the client app with
cd client && yarn start - Visit
localhost:3001in your browser
Redis data structure
A room consists of 2 elements in Redis:
eph:room:room-tokenSTRING A room token issued to the room opener to keep room open. Expires in 120 seconds without akeep-alivemessage.eph:room:${roomId}CHANNEL A pub sub channel for sending messages to the host and guests of a room.
API design
Host open a room:
POST /api/room returns { roomId, roomToken }
Keep-alive & opens for host (keeps roomToken in Redis, which expires after unuse) websocket:
{
"type": "host-keepalive",
"roomId": "roomId",
"body": "roomToken"
}Host broadcast content
Broadcast content:
{
"type": "send-room",
"roomId": "roomId",
"body": "encryptedRoomContent"
}Room closed (closed by host or expired)
{
"type": "close-room",
"roomId": "roomId"
}
Host receive guest attendance
Guest joined and/or keep alive, will re-broadcast room content:
{
"type": "guest-keepalive",
"roomId": "roomId",
"body": {
"guestId": "Unique guest ID",
"os": "Operating System",
"browser": "Browser Name",
"location": "Location description",
"ip": "IP Address"
}
}Guest disconnected:
{
"type": "guest-disconnect",
"roomId": "roomId",
"body": {
"guestId": "Unique guest ID"
}
}Signaling server
Messages
hostKeepalive - Sent by the host of the room to keep the room open. Resets the TTL on the roomId:roomToken
{
"type": "hostKeepalive",
"roomId": "<roomId>",
"roomToken": "<roomToken>",
}hostSendMessage - Sent by the host of the room to send a message to a specific guest
{
"type": "hostSendMessage",
"roomId": "<roomId>",
"roomToken": "<roomToken>",
"guestId": "<targetGuestId>",
"message": "<messageContent>"
}guestKeepalive - Send by a guest of the room to send id and profile information to the host. Makes the host send the message to the guest again.
{
"type": "guestKeepalive",
"roomId": "<roomId>"
}The server then adds details to the guestKeepalive from the User Agent and IP address details, resulting in the following getting forwarded to the host:
{
"type": "guestKeepalive",
"roomId": "<roomId>"
}