{"id":20617166,"url":"https://github.com/yiweisong/node-ace-pcap","last_synced_at":"2025-03-06T19:22:35.901Z","repository":{"id":70083124,"uuid":"567149131","full_name":"yiweisong/node-ace-pcap","owner":"yiweisong","description":"Capture packet in a specified network","archived":false,"fork":false,"pushed_at":"2023-09-08T07:46:37.000Z","size":150,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-17T04:33:46.232Z","etag":null,"topics":["capture","node-addon-api","pcap"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yiweisong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-11-17T07:08:02.000Z","updated_at":"2024-11-07T03:18:36.000Z","dependencies_parsed_at":"2024-11-16T11:24:32.373Z","dependency_job_id":"916699f4-c28d-475f-a742-204f1789bca6","html_url":"https://github.com/yiweisong/node-ace-pcap","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiweisong%2Fnode-ace-pcap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiweisong%2Fnode-ace-pcap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiweisong%2Fnode-ace-pcap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiweisong%2Fnode-ace-pcap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiweisong","download_url":"https://codeload.github.com/yiweisong/node-ace-pcap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242269832,"owners_count":20100189,"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":["capture","node-addon-api","pcap"],"created_at":"2024-11-16T11:22:26.107Z","updated_at":"2025-03-06T19:22:35.881Z","avatar_url":"https://github.com/yiweisong.png","language":"C++","readme":"# Node Aceinna PCap\n\nThis is a node-addon-api native addon to capture packet from a specifed network. Some code is referenced from https://github.com/mscdex/cap.git\n\n\u003e You need to have Node 10.5.0 or later installed.\n\n## How to use\n\n### Install\n\n```\nnpm install ace-pcap\n```\n\n### Sample Code\n\n\u003e Basic\n\n```Javascript\nimport { EthernetPacketCapture, GetNetworkInterface } from 'ace-pcap'\nconst ip = '192.168.22.140'; // IP Address of network for capture packet\nconst iface = GetNetworkInterface(ip);\nconst instance = new EthernetPacketCapture({ iface });\n\ninstance.on('data', (data) =\u003e {\n    console.log(data);\n})\n\ninstance.start();\n```\n\n\u003e Filter\n\n```Javascript\nimport { EthernetPacketCapture, GetNetworkInterface } from 'ace-pcap'\nconst ip = '192.168.22.140'; // IP Address of network for capture packet\nconst filter = `ether src 88:e9:fe:52:68:56`;\nconst iface = GetNetworkInterface(ip);\nconst instance = new EthernetPacketCapture({ iface, filter });\n\ninstance.on('data', (data) =\u003e {\n  console.log(data);\n})\n\ninstance.start();\n\n// update filter while capturing\nsetTimeout(()=\u003e{\n  instance.setFilter('ether src 98:5f:d3:3c:ab:fd');\n},5000)\n```\n\n\u003e Send packet to network\n\n```Javascript\nimport { EthernetPacketCapture, GetNetworkInterface } from 'ace-pcap'\nconst ip = '192.168.22.140'; // IP Address of network for capture packet\nconst iface = GetNetworkInterface(ip);\nconst instance = new EthernetPacketCapture({ iface });\n\ninstance.start();\n\n// update filter while capturing\nsetTimeout(()=\u003e{\n  instance.send(Buffer.from('data to send'))\n},5000)\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiweisong%2Fnode-ace-pcap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiweisong%2Fnode-ace-pcap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiweisong%2Fnode-ace-pcap/lists"}