{"id":20784876,"url":"https://github.com/emad-elsaid/inbox","last_synced_at":"2025-05-05T03:23:18.690Z","repository":{"id":66682043,"uuid":"271640473","full_name":"emad-elsaid/inbox","owner":"emad-elsaid","description":"📮 WebRTC fast signaling HTTP server","archived":false,"fork":false,"pushed_at":"2020-08-01T11:43:09.000Z","size":90,"stargazers_count":34,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T21:41:24.802Z","etag":null,"topics":["camera","go","golang","p2p","signaling-server","video","webrtc"],"latest_commit_sha":null,"homepage":"https://www.inboxgo.org","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emad-elsaid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-11T20:27:01.000Z","updated_at":"2024-04-01T04:46:48.000Z","dependencies_parsed_at":"2023-03-11T00:13:50.330Z","dependency_job_id":null,"html_url":"https://github.com/emad-elsaid/inbox","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emad-elsaid%2Finbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emad-elsaid%2Finbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emad-elsaid%2Finbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emad-elsaid%2Finbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emad-elsaid","download_url":"https://codeload.github.com/emad-elsaid/inbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252430484,"owners_count":21746667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["camera","go","golang","p2p","signaling-server","video","webrtc"],"created_at":"2024-11-17T14:34:13.518Z","updated_at":"2025-05-05T03:23:18.625Z","avatar_url":"https://github.com/emad-elsaid.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"📮 INBOX\n=========\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/emad-elsaid/inbox)](https://goreportcard.com/report/github.com/emad-elsaid/inbox)\n[![GoDoc](https://godoc.org/github.com/emad-elsaid/inbox?status.svg)](https://godoc.org/github.com/emad-elsaid/inbox)\n[![codecov](https://codecov.io/gh/emad-elsaid/inbox/branch/master/graph/badge.svg)](https://codecov.io/gh/emad-elsaid/inbox)\n[![Maintainability](https://api.codeclimate.com/v1/badges/fd33b21eee2826d1f763/maintainability)](https://codeclimate.com/github/emad-elsaid/inbox/maintainability)\n[![Join the chat at https://gitter.im/inbox-server/community](https://badges.gitter.im/inbox-server/community.svg)](https://gitter.im/inbox-server/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nInbox makes it easy to setup a WebRTC HTTPS signaling server\n\n\u003c!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --\u003e\n**Table of Contents**\n\n- [📮 INBOX](#📮-inbox)\n    - [Features](#features)\n    - [Install](#install)\n        - [Download latest binary](#download-latest-binary)\n        - [Compile from source](#compile-from-source)\n        - [Docker image](#docker-image)\n        - [Free public instances](#free-public-instances)\n    - [Usage](#usage)\n    - [Tutorial](#tutorial)\n    - [API Documentation](#api-documentation)\n    - [Purpose](#purpose)\n    - [How is it working?](#how-is-it-working)\n    - [The General Concept](#the-general-concept)\n    - [The implementation](#the-implementation)\n    - [How to run the example](#how-to-run-the-example)\n    - [Benchmarks](#benchmarks)\n    - [Contribute](#contribute)\n    - [License](#license)\n\n\u003c!-- markdown-toc end --\u003e\n\n## Features\n\n* HTTP and HTTPS mode\n* Allows period polling or long polling\n* In-memory state, no need for persistent storage\n* Allows Cross-Origin Resource Sharing (CORS)\n* Serves Static files from a directory\n* Allows limiting request body size and headers size\n* Flexible way to limit maximum number of messages per user\n\n## Install\n\n### Download latest binary\n\nYou can download [the latest version from\nreleases](https://github.com/emad-elsaid/inbox/releases/latest) for your\nsystem/architecture\n\n### Compile from source\n\n- Have the [Go toolchain](https://golang.org/dl/) installed\n- Clone the repository and compile and install the binary to $GOBIN\n  ```\n  git clone git@github.com:emad-elsaid/inbox.git\n  cd inbox\n  go install cmd/inbox.go\n  ```\n\n### Docker image\n\n- If you want to run it in http mode\n  ```\n  docker run --rm -it -p 3000:3000 emadelsaid/inbox ./inbox --https=false\n  ```\n- You can use generate a self signed SSL certificate, or if you already have a\n  certificate if you want to have HTTPS enabled\n  ```\n  docker run --rm -it -v /path/to/cert/directory:/cert -p 3000:3000 emadelsaid/inbox ./inbox --server-cert=/cert/server.crt --server-key=/cert/server.key\n  ```\n\n### Free public instances\n\nThe following are public instances you can use instead of running your own:\n\n- https://connect.inboxgo.org/inbox Official public instance\n\n## Usage\n\n```\n  -bind string\n        a bind for the http server (default \"0.0.0.0:3000\")\n  -cleanup-interval int\n        Interval in seconds between server cleaning up inboxes (default 1)\n  -cors\n        Allow CORS\n  -https\n        Run server in HTTPS mode or HTTP (default true)\n  -inbox-capacity int\n        Maximum number of messages each inbox can hold (default 100)\n  -inbox-timeout int\n        Number of seconds for the inbox to be inactive before deleting (default 60)\n  -long-polling\n        Allow blocking get requests until a message is available in the inbox (default true)\n  -max-body-size int\n        Maximum request body size in bytes (default 1048576)\n  -max-header-size int\n        Maximum request body size in bytes (default 1048576)\n  -public string\n        Directory path of static files to serve (default \"public\")\n  -server-cert string\n        HTTPS server certificate file (default \"server.crt\")\n  -server-key string\n        HTTPS server private key file (default \"server.key\")\n```\n\n## Tutorial\n\nIf you're new to writing WebRTC application I recommend you make yourself\nfamiliar with [the basic concepts from\ngoogle](https://webrtc.org/getting-started/overview), For a tutorial about how\nto use Inbox I got you covered from installation to Javascript communication\n[Read more](/docs/tutorial.md)\n\n## API Documentation\n\n- Swagger documentation is under [/docs/swagger.yml](/docs/swagger.yml)\n- You can show it [ online here ](https://petstore3.swagger.io/?url=https://raw.githubusercontent.com/emad-elsaid/inbox/master/docs/swagger.yml)\n\n## Purpose\n\n- When building a WebRTC based project you need a way to signal peers.\n- One of the ways to signal peers is to use a central HTTP server\n- Alice uses **Inbox** to pass WebRTC offer to Bob\n- Bob gets the offer uses **Inbox** to send a WebRTC answer to Alice\n- Alice and Bob use **Inbox** to exchange ICE Candidates information\n- When Alice and Bob have enough ICE candidates they disconnect from **Inbox** and connect to each other directly\n\n## How is it working?\n\n- The server works in HTTPS mode by default unless `-https=false` passed to it.\n- If you wish to generate self signed SSL certificate `server.key` and `server.crt`:\n```\nopenssl genrsa -des3 -passout pass:secretpassword -out server.pass.key 2048\nopenssl rsa -passin pass:secretpassword -in server.pass.key -out server.key\nopenssl req -new -key server.key -out server.csr\nopenssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt\n```\n- it uses Go to run a HTTPS server on port 3000 that serves `./public` directory\n- The local server has 1 other route `/inbox` for the sender and receiver to signal each\n  other the webRTC offer and answer.\n\n## The General Concept\n\nInbox acts as a temporary mailbox between peers, the server creates the inbox\nupon the first interaction with the user and deletes it after a duration of\ninactivity which is 1 minute by default [Read more](/docs/concept.md)\n\n## The implementation\n\n- This is a HTTPS server written in Go\n- No third party dependencies\n- Stores all data in memory in one big memory structure\n- Every second the server removes inboxes exceeded timeouts\n- Serves `/public` in current working directory as static files\n- CORS is disabled by default\n\n## How to run the example\n\n- Install [Go](https://golang.org/)\n- Clone this repository `git clone git@github.com:emad-elsaid/inbox.git`\n- Run the server `go run ./cmd/inbox.go`\n- Open `https://your-ip-address:3000/send.html` on the camera machine\n- Open `https://your-ip-address:3000/receive.html` on the receiver machine\n- Choose the camera from the list on the sender and press `start` button\n- The receiver should display the camera shortly after\n\n## Benchmarks\n\nInbox inherits the high speed of Go and as it uses the RAM as storage its mostly\na CPU bound process, the project comes with go benchmarks you can test it on\nyour hardware yourself, You can checkout my CPU specs and benchmark numbers on\nmy machine here [Read more](/docs/benchmarks.md)\n\n## Contribute\n\nExpected contribution flow will be as follows:\n\n* Read and understand the code\n* Make some changes related to your idea\n* Open a PR to validate you're in the right direction, describe what you're\n  trying to do\n* Continue working on your changes until it's fully implemented\n* I'll merge it and release a new version\n\n## License\n\nMIT License (c) Emad Elsaid\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femad-elsaid%2Finbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femad-elsaid%2Finbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femad-elsaid%2Finbox/lists"}