{"id":28306475,"url":"https://github.com/clxrityy/gatenet","last_synced_at":"2026-03-08T10:36:57.491Z","repository":{"id":294721143,"uuid":"986810919","full_name":"clxrityy/gatenet","owner":"clxrityy","description":"Python networking toolkit for sockets, TCP/UDP, and HTTP microservices","archived":false,"fork":false,"pushed_at":"2025-06-28T22:09:42.000Z","size":210,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-28T22:27:05.432Z","etag":null,"topics":["http","http-server","socket","socket-server","tcp","tcp-client","tcp-server","udp","udp-client","udp-server"],"latest_commit_sha":null,"homepage":"https://gatenet.readthedocs.io/en/latest/","language":"Python","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/clxrityy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2025-05-20T06:49:25.000Z","updated_at":"2025-06-28T22:09:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"0a475ef2-18e9-418d-8e2c-e2bf5953606d","html_url":"https://github.com/clxrityy/gatenet","commit_stats":null,"previous_names":["clxrityy/gatenet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clxrityy/gatenet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clxrityy%2Fgatenet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clxrityy%2Fgatenet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clxrityy%2Fgatenet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clxrityy%2Fgatenet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clxrityy","download_url":"https://codeload.github.com/clxrityy/gatenet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clxrityy%2Fgatenet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262685693,"owners_count":23348451,"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":["http","http-server","socket","socket-server","tcp","tcp-client","tcp-server","udp","udp-client","udp-server"],"created_at":"2025-05-24T04:11:52.309Z","updated_at":"2026-03-08T10:36:57.445Z","avatar_url":"https://github.com/clxrityy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gatenet 🛰️\n\n##### BETA\n\n[![Changelog](https://img.shields.io/badge/changelog-log?logo=gitbook\u0026logoColor=%23333333\u0026color=%23BBDDE5\u0026link=https%3A%2F%2Fgithub.com%2Fclxrityy%2Fgatenet%2Fblob%2Fmaster%2FCHANGELOG.md)](https://github.com/clxrityy/gatenet/blob/master/CHANGELOG.md)\n[![Static Badge](https://img.shields.io/badge/readthedocs-readme?style=social\u0026logo=readthedocs\u0026logoColor=%238CA1AF\u0026link=https%3A%2F%2Fgatenet.readthedocs.io%2Fen%2Flatest%2F)](https://gatenet.readthedocs.io/en/latest/)\n\n|             |                                                                                                                                                                                                                                                                                 |\n| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **Package** | [![PyPI](https://img.shields.io/pypi/v/gatenet)](https://pypi.org/project/gatenet/)                                                                                                                                                                                             |\n| **Python**  | [![Python](https://img.shields.io/pypi/pyversions/gatenet)](https://pypi.org/project/gatenet/)                                                                                                                                                                                  |\n| **Tests**   | [![CI](https://github.com/clxrityy/gatenet/actions/workflows/test.yml/badge.svg)](https://github.com/clxrityy/gatenet/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/clxrityy/gatenet/graph/badge.svg?token=4644O5NGW9)](https://codecov.io/gh/clxrityy/gatenet) |\n| **License** | [![License](https://img.shields.io/github/license/clxrityy/gatenet)](LICENSE)                                                                                                                                                                                                   |\n\n```mermaid\nmindmap\n  root(🛰️)\n    diagnostics/\n      dns\n      geo\n      ping\n      port_scan\n    client/\n      base\n        TCP\n        UDP\n    http_/\n        base\n            client\n            server\n            async_client\n    socket/\n        base\n            TCP\n            UDP\n    discovery/\n        MDNS\n        UPNP\n        SSH\n        bluetooth\n```\n\n\u003e Python networking toolkit for sockets, UDP, and HTTP microservices — modular and testable.\n\n- [Changelog](https://github.com/clxrityy/gatenet/blob/master/CHANGELOG.md)\n- [Installation](#installation)\n- [Features](#features)\n- [Quickstart](#quickstart)\n- [Usage Examples](#usage-examples)\n- [Service Discovery](#service-discovery)\n- [Diagnostics](#diagnostics)\n- [Tests](#tests)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## Installation\n\n```zsh\npip install gatenet\n```\n\n## Features\n\n- **Modular**: Each component is modular and can be used independently.\n- **Testable**: Each component is designed to be testable with unit tests.\n- **Service Discovery**: Identify running services (SSH, HTTP, FTP, SMTP, etc.) using banners and ports.\n- **Diagnostics**: Tools for traceroute, latency, and bandwidth measurement.\n- **Socket Servers \u0026 Clients**: TCP, UDP, and HTTP server/client implementations.\n- **Async Support**: Asynchronous HTTP client and server.\n- **Extensible**: Strategy and chain-of-responsibility patterns for easy extension.\n- **Comprehensive Documentation**: With examples and usage guides.\n\n---\n\n## Quickstart\n\n### TCP Client\n\n```python\nfrom gatenet.client.tcp import TCPClient\n\nclient = TCPClient(host=\"127.0.0.1\", port=12345)\nclient.connect()\nresponse = client.send(\"ping\")\nprint(response)\nclient.close()\n```\n\n### HTTP Server\n\n```python\nfrom gatenet.http.server import HTTPServer\n\nserver = HTTPServer(host=\"0.0.0.0\", port=8080)\n\n@server.route(\"/status\", method=\"GET\")\ndef status_handler(req):\n    return {\"ok\": True}\n\nserver.serve()\n```\n\n---\n\n## Usage Examples\n\n### Service Discovery\n\nIdentify a service by port and banner:\n\n```python\nfrom gatenet.discovery.ssh import _identify_service\n\nservice = _identify_service(22, \"SSH-2.0-OpenSSH_8.9p1\")\nprint(service)  # Output: \"OpenSSH 8.9p1\"\n```\n\nUse a specific detector:\n\n```python\nfrom gatenet.discovery.ssh import HTTPDetector\n\ndetector = HTTPDetector()\nresult = detector.detect(80, \"apache/2.4.41\")\nprint(result)  # Output: \"Apache HTTP Server\"\n```\n\n### Custom Service Detector\n\n```python\nfrom gatenet.discovery.ssh import ServiceDetector\nfrom typing import Optional\n\nclass CustomDetector(ServiceDetector):\n    \"\"\"Custom service detector implementation.\"\"\"\n    def detect(self, port: int, banner: str) -\u003e Optional[str]:\n        if 'myapp' in banner:\n            return \"MyCustomApp\"\n        return None\n```\n\n---\n\n## Service Discovery\n\n- **SSH, HTTP, FTP, SMTP, and more**: Uses a strategy pattern and chain of responsibility for extensible service detection.\n- **Banner and port-based detection**: Extracts service names and versions from banners and well-known ports.\n- **Fallback detection**: Always returns a result, even for unknown services.\n\nSee [examples/discovery/ssh_discovery.py](examples/discovery/ssh_discovery.py) for more.\n\n---\n\n## Diagnostics\n\n- **Traceroute**: Trace the route to a host.\n- **Latency Measurement**: Measure round-trip time to a host.\n- **Bandwidth Measurement**: (Planned) Measure throughput to a host.\n\nExample traceroute:\n\n```python\nfrom gatenet.diagnostics.traceroute import traceroute\n\nhops = traceroute(\"google.com\")\nfor hop in hops:\n    print(hop)\n```\n\n---\n\n## Tests\n\nRun all tests with:\n\n```bash\npytest\n```\n\n- Uses `pytest` for all tests.\n- Includes unit and integration tests for all modules.\n- Use `get_free_port()` from `gatenet.utils.net` in tests to avoid port conflicts.\n\n---\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n- Follow the code style and patterns used in the project.\n- Add tests for new features.\n- Update documentation as needed.\n\n---\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclxrityy%2Fgatenet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclxrityy%2Fgatenet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclxrityy%2Fgatenet/lists"}