{"id":20968491,"url":"https://github.com/jack-q/messenger","last_synced_at":"2025-08-09T00:10:42.488Z","repository":{"id":90232551,"uuid":"88654659","full_name":"Jack-Q/messenger","owner":"Jack-Q","description":"Cross platform messenger","archived":false,"fork":false,"pushed_at":"2017-07-06T05:25:46.000Z","size":3936,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-14T09:44:26.756Z","etag":null,"topics":["chat","electron","messenger","p2p","voip"],"latest_commit_sha":null,"homepage":"https://git.io/msg","language":"Java","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/Jack-Q.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"zenodo":null}},"created_at":"2017-04-18T17:57:06.000Z","updated_at":"2020-11-03T08:49:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"4ef7a4c6-282f-41e0-a44a-09974b10d982","html_url":"https://github.com/Jack-Q/messenger","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Jack-Q/messenger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jack-Q%2Fmessenger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jack-Q%2Fmessenger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jack-Q%2Fmessenger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jack-Q%2Fmessenger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jack-Q","download_url":"https://codeload.github.com/Jack-Q/messenger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jack-Q%2Fmessenger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269508713,"owners_count":24428743,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["chat","electron","messenger","p2p","voip"],"created_at":"2024-11-19T03:13:20.022Z","updated_at":"2025-08-09T00:10:42.463Z","avatar_url":"https://github.com/Jack-Q.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Messenger, Chat on multiple platforms\n\n[![Build Status](https://travis-ci.org/Jack-Q/messenger.svg?branch=master)](https://travis-ci.org/Jack-Q/messenger)\n\nMessenger is a simple chat application for desktop platform (Windows, Mac OS, Linux) and mobile platform (Android),\nwhich supports both text based chatting and audio based chatting.\n\n\n## Screenshots\n\n\n|![01](./docs/01.png) | ![02](./docs/02.png)|\n|:------:|:-------:|\n|![03](./docs/03.png) | ![04](./docs/04.png)|\n\n\n\n## Network\n\n### Basic Structure\n```\n    ___________UDP___________\n    |                       |\nClient 1 -TCP-\\     /-TCP- Client 2\n              |     |\n              |     |\n          Central server\n```\n\n### Protocol\n\n* Client-Server Protocol: [client-server](./protocol/client-server.md)\n* Peer-to-Peer Protocol: [peer-to-peer](./protocol/peer-to-peer.md)\n\n### P2P over NAT (NAT hole punching)\n\nClient-Server Protocol Peer-to-Peer Protocol provides a simple implementation of P2P over NAT.\n\n```\n           | (host:port) |  \nClient 1   |    Server   |     Client 2\n     \\---NAT---/     \\---NAT---/\n           |             |\n           |             |\n\n                 ||\n                 \\/\n\n           |             |  \nClient 1   |    Server   |     Client 2\n     \\---NAT-------------NAT---/\n           |             |\n           |             |\n```\n\n* Server has public accessible UDP address (host:port);\n* Client 1 sends packet to server, then server knows its NAT mapped UDP address. Server send this information to Client 2;\n* Client 2 sends packet to server, then server knows its NAT mapped UDP address. Server send this information to Client 1;\n* Client 1 sends packet to Client 2 with address received from Server;\n* Client 2 sends packet to Client 1 with address received from Server;\n* If Client 1 or Client 2 can receive UDP packet from peer, then P2P communication is viable in between.\n\n\n## Audio Processing\n\n### Audio Recording\n\nFor desktop client, the audio data is recorded by Web API, while for mobile client, that is done with Android API.\n* WebAudio: [`MediaRecorder`](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_Recording_API/Using_the_MediaStream_Recording_API)\n* Android SDK: [`MediaRecorder`](https://developer.android.com/guide/topics/media/mediarecorder.html)\n\n### Audio Encoding\n\nAudio data collected via platform specific API is sliced and encoded before transmission over network.\nThe encoding method used by `messenger` is OPUS encoding.\n\n* Implementation [http://opus-codec.org](http://opus-codec.org)\n* RFC 6716 [https://tools.ietf.org/html/rfc6716](https://tools.ietf.org/html/rfc6716)\n\n### Desktop Client Audio Processing Flow\n```\n           Sender                  Receiver\n         Microphone            Headphone/Speaker\n     Recorder |                 Player |\n        [Float32Array]        [AudioBufferSource]\n     PcmCodec |                        |\n         [Int16Array]            [AudioBuffer]\nInFrameBuffer |         OutFrameBuffer |\n          [PcmFrame]              [PcmFrame]\n    OpusCodec |                        |\n         [OpusFrame]              [OpusFrame]\n  AudioPacker |                        |\n      [AudioPacketData]        [AudioPacketData] \n  UdpProtocol |                        |\n        [UDP-Packet]             [UDP-Packet]\n              |                        |\n              \\-[UDP Socket \u0026 Network]-/\n```\n\n\n## Miscellaneous\n\n### Build native module in node\nSince `electron` is generally bundled a different version of `v8` than nodejs, the native node module requires recompiling to work correctly.\nUse the `electron-rebuild` package for this task.\n\n****\nMIT Licence. Copyright (c) 2017 Jack Q\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjack-q%2Fmessenger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjack-q%2Fmessenger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjack-q%2Fmessenger/lists"}