{"id":48244835,"url":"https://github.com/stefanwerfling/node-rohc","last_synced_at":"2026-04-04T20:29:51.136Z","repository":{"id":213358698,"uuid":"731517364","full_name":"stefanwerfling/node-rohc","owner":"stefanwerfling","description":"Binding ROHC library","archived":false,"fork":false,"pushed_at":"2024-07-30T07:11:11.000Z","size":201,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-30T13:06:52.890Z","etag":null,"topics":["binding","ip","napi","network","nodejs","rohc","rohc-library"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stefanwerfling.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}},"created_at":"2023-12-14T09:03:00.000Z","updated_at":"2024-07-30T07:10:18.000Z","dependencies_parsed_at":"2023-12-26T17:19:18.288Z","dependency_job_id":"802de13a-63db-402b-bb52-9eed35ef51fa","html_url":"https://github.com/stefanwerfling/node-rohc","commit_stats":null,"previous_names":["stefanwerfling/node-rohc"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/stefanwerfling/node-rohc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanwerfling%2Fnode-rohc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanwerfling%2Fnode-rohc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanwerfling%2Fnode-rohc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanwerfling%2Fnode-rohc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanwerfling","download_url":"https://codeload.github.com/stefanwerfling/node-rohc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanwerfling%2Fnode-rohc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31413230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["binding","ip","napi","network","nodejs","rohc","rohc-library"],"created_at":"2026-04-04T20:29:50.372Z","updated_at":"2026-04-04T20:29:51.120Z","avatar_url":"https://github.com/stefanwerfling.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/stefanwerfling/node-rohc)\n\n# Node-Rohc\nNode.js Binding ROHC library, see more on https://github.com/stefanwerfling/rohc. \n* More information, see on: https://de.wikipedia.org/wiki/ROHC.\n* Inspired by: \n  * https://github.com/airbus-cyber/IP2LoRa \n  * https://www.cyber.airbus.com/ip2lora-a-diverted-use-of-lora-to-build-your-wireless-ip-link-over-kilometers/\n\nA package for binding to the rohc library with Typescript.\nIt will later be combined with https://github.com/stefanwerfling/node-tuntap2.\nIt is intended to reduce data traffic, for example via LoRa, a VPN or etc.\n\nThis is an alpha version 1.0.5!\n\n## Rohc install\n```shell\nsudo apt-get install autotools-dev\nsudo apt-get install automake\nsudo apt-get install libtool\nsudo apt-get install libpcap-dev\nsudo apt-get install -y libcmocka-dev\n\ngit clone https://github.com/stefanwerfling/rohc.git\ncd rohc\n\n./autogen.sh --prefix=/usr\n\nmake all\nsudo make install\n```\n\n```shell\ncd yourProject\n```\n\n```shell\nnpm intall git+https://github.com/stefanwerfling/node-rohc\n```\n\nor \n\n```shell\nnpm i node-rohc\n```\n\n## Check build by hand:\n```shell\nnpm run build --loglevel verbose\n```\n\n## Used\n```js\nimport {Rohc, RohcProfiles, RohcStatus} from 'node-rohc';\n\nconsole.log(Rohc.getVersion());\n\nconst r = new Rohc([\n  RohcProfiles.ROHC_PROFILE_UNCOMPRESSED,\n  RohcProfiles.ROHC_PROFILE_IP,\n  RohcProfiles.ROHC_PROFILE_TCP,\n  RohcProfiles.ROHC_PROFILE_UDP,\n  RohcProfiles.ROHC_PROFILE_ESP,\n  RohcProfiles.ROHC_PROFILE_RTP\n]);\n\nr.setLogger(msg =\u003e {\n    console.log(msg);\n});\n\ntry {\n    const compress = r.compress(new Uint8Array(ipPacketBufferWithContent));\n\n    console.log(compress);\n\n    if (compress) {\n        console.log(Buffer.from(compress).toString(\"hex\"));\n\n        const decompress = r.decompress(compress);\n\n        console.log(decompress);\n\n        if (decompress) {\n            console.log(Buffer.from(decompress).toString(\"hex\"));\n        }\n    }\n\n    if (r.getLastStatus() === RohcStatus.ROHC_OK) {\n      console.log('All OK');\n    }\n    \n    console.log(r.compressLastPacketInfo());\n    console.log(r.compressGeneralInfo());\n    console.log(r.decompressLastPacketInfo());\n    console.log(r.decompressGeneralInfo());\n} catch (e) {\n    console.error(e);\n}\n```\n\nOutput:\n```text\nDebugger attached.\nUint8Array(52) [\n   69,   0,   0,  52,   0,   0,   0,   0,  64,  6, 249,\n  112, 192, 168,   0,   1, 192, 168,   0,   2, 72, 101,\n  108, 108, 111,  44,  32, 116, 104, 105, 115, 32, 105,\n  115,  32, 116, 104, 101,  32, 100,  97, 116, 97,  32,\n  112,  97, 121, 108, 111,  97, 100,  33\n]\n2.4.0~a0d95093\nBuffer Dump: 45 00 00 34 00 00 00 00 40 06 f9 70 c0 a8 00 01 c0 a8 00 02 48 65 6c 6c 6f 2c 20 74 68 69 73 20 69 73 20 74 68 65 20 64 61 74 61 20 70 61 79 6c 6f 61 64 21 \n[rohc_comp.c:640 rohc_comp_get_profile()] ROHCv1 Uncompressed profile is possible\n\n[rohc_comp.c:1022 rohc_comp_are_ip_hdrs_supported()] found IPv4\n\n[rohc_comp.c:1078 rohc_comp_are_ip_hdrs_supported()]    source address = c0a80001 (192.168.0.1)\n...\n\n[rohc_comp.c:1595 rohc_compress4()] copy full 32-byte payload\n\n[rohc_comp.c:1603 rohc_compress4()] ROHC size = 53 bytes (header = 21, payload = 32), output buffer size = 2048\n\ncompress status: = 0\nUint8Array(53) [\n  253,   4,  69,  64,   6, 192, 168,   0,   1, 192, 168,\n    0,   2,   0,  64,   0,   0,  32,   0, 251, 103,  72,\n  101, 108, 108, 111,  44,  32, 116, 104, 105, 115,  32,\n  105, 115,  32, 116, 104, 101,  32, 100,  97, 116,  97,\n   32, 112,  97, 121, 108, 111,  97, 100,  33\n]\nfd04454006c0a80001c0a80002004000002000fb6748656c6c6f2c2074686973206973207468652064617461207061796c6f616421\nBuffer Dump: fd 04 45 40 06 c0 a8 00 01 c0 a8 00 02 00 40 00 00 20 00 fb 67 48 65 6c 6c 6f 2c 20 74 68 69 73 20 69 73 20 74 68 65 20 64 61 74 61 20 70 61 79 6c 6f 61 64 21 \n[rohc_decomp.c:793 rohc_decompress3()] decompress the 53-byte packet #1\n\n[rohc_decomp.c:3924 rohc_decomp_parse_padding()] skip 0 byte(s) of padding\n\n[rohc_decomp.c:3852 rohc_decomp_decode_cid()] no add-CID found, CID defaults to 0\n\n....\n\ndecompress status: = 0\nUint8Array(52) [\n   69,   0,   0,  52,   0,   0,   0,   0,  64,  6, 249,\n  112, 192, 168,   0,   1, 192, 168,   0,   2, 72, 101,\n  108, 108, 111,  44,  32, 116, 104, 105, 115, 32, 105,\n  115,  32, 116, 104, 101,  32, 100,  97, 116, 97,  32,\n  112,  97, 121, 108, 111,  97, 100,  33\n]\n45000034000000004006f970c0a80001c0a8000248656c6c6f2c2074686973206973207468652064617461207061796c6f616421\nAll OK\n{\n  version_major: 0,\n  version_minor: 0,\n  context_id: 0,\n  is_context_init: true,\n  context_mode: 1,\n  context_state: 1,\n  context_used: true,\n  profile_id: 4,\n  packet_type: 0,\n  total_last_uncomp_size: 52,\n  header_last_uncomp_size: 20,\n  total_last_comp_size: 53,\n  header_last_comp_size: 21\n}\n{\n  version_major: 0,\n  version_minor: 0,\n  contexts_nr: 1,\n  packets_nr: 1,\n  uncomp_bytes_nr: 52,\n  comp_bytes_nr: 53\n}\n{\n  version_major: 0,\n  version_minor: 0,\n  context_mode: 2,\n  context_state: 3,\n  profile_id: 4,\n  nr_lost_packets: 0,\n  nr_misordered_packets: 0,\n  is_duplicated: false,\n  corrected_crc_failures: 11745388377929038000,\n  corrected_sn_wraparounds: 14987979559889062000,\n  corrected_wrong_sn_updates: 12105675798372346000,\n  packet_type: 449595,\n  total_last_comp_size: 18407961667527770000,\n  header_last_comp_size: 1940628627783807,\n  total_last_uncomp_size: 18407961667125117000,\n  header_last_uncomp_size: 217316637802623\n}\n{\n  version_major: 0,\n  version_minor: 0,\n  contexts_nr: 1,\n  packets_nr: 1,\n  comp_bytes_nr: 53,\n  uncomp_bytes_nr: 52,\n  corrected_crc_failures: 0,\n  corrected_sn_wraparounds: 8518447232180027000,\n  corrected_wrong_sn_updates: 4295000063\n}\n\n\n```\n\n## Dev\n#### Missing rohclib.o\nSet path for the Linker to the libary:\n```shell\nexport LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH\nnpm run build --loglevel verbose\n```\n\n## Doc\n* https://rohc-lib.org/support/documentation/API/rohc-doc-2.3.1/group__rohc.html\n\n## Helpful pages\n* https://hpd.gasmi.net/\n* https://www.sharetechnote.com/html/Handbook_LTE_ROHC.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanwerfling%2Fnode-rohc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanwerfling%2Fnode-rohc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanwerfling%2Fnode-rohc/lists"}