{"id":20321965,"url":"https://github.com/postuf/socksproxyasync","last_synced_at":"2025-04-11T19:10:59.073Z","repository":{"id":36758401,"uuid":"229939847","full_name":"Postuf/SocksProxyAsync","owner":"Postuf","description":"Lightweight asynchronous socks proxy client for PHP","archived":false,"fork":false,"pushed_at":"2024-03-16T04:29:37.000Z","size":213,"stargazers_count":4,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T22:07:49.597Z","etag":null,"topics":["async","php","proxy","socket"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/Postuf.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}},"created_at":"2019-12-24T12:40:52.000Z","updated_at":"2024-12-19T04:05:38.000Z","dependencies_parsed_at":"2023-01-17T04:34:17.119Z","dependency_job_id":null,"html_url":"https://github.com/Postuf/SocksProxyAsync","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Postuf%2FSocksProxyAsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Postuf%2FSocksProxyAsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Postuf%2FSocksProxyAsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Postuf%2FSocksProxyAsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Postuf","download_url":"https://codeload.github.com/Postuf/SocksProxyAsync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248465344,"owners_count":21108244,"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":["async","php","proxy","socket"],"created_at":"2024-11-14T19:18:11.872Z","updated_at":"2025-04-11T19:10:59.051Z","avatar_url":"https://github.com/Postuf.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SocksProxyAsync\n\nAsynchronous SOCKS5 client library\n\n[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/Postuf/SocksProxyAsync)\n\n[![codecov](https://codecov.io/gh/Postuf/SocksProxyAsync/branch/master/graph/badge.svg)](https://codecov.io/gh/Postuf/SocksProxyAsync)\n\n## Requirements\n\n* PHP 7.4+\n* Composer\n  * ext-sockets\n\n## Quick start\n\nFirst of all, add library to your app user `composer`:\n```\ncomposer require postuf/socks-proxy-async\n```\n\n## How it works\n\nSay, you have a socket and an event loop:\n```\n$socket = new SocketAsync(/* ... */);\nwhile(true) {\n  // process events\n  if (!$socket-\u003eready()) {\n    $socket-\u003epoll();\n  } else {\n    // your logic ...\n  }\n}\n```\n\nWe create socket, set [socket_set_nonblock](https://www.php.net/manual/ru/function.socket-set-nonblock.php), when socket is connected, `isReady` flag is set.\nInternal logic is organized as state machine. You can extend it and add more steps, so that only `$socket-\u003epoll()` is called on event loop, then you just check the state and process received updates.\n\n## Testing\n\nTests require working proxy and http server to be up and running, use `node/proxy.js` to start proxy, `node/http/start.sh` (`./start.sh` within its subdir) to start http server.\nBy default, http server runs on port 8080, proxy occupies port 1080, tests use these ports.\n\nDNS-related tests require dns server (`node/named.js`) to be up and running.\n\n### Make commands\n\n- make all - run all checks\n\n- make test - run tests\n  \n- make cs - run codesniffer checks\n  \n- make psalm - run psalm checks\n  \n- make stan - run stan checks\n  \n- make cs - run stan and psalm checks\n\n- make get-security - get security checker\n\n- make security - run security checker\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostuf%2Fsocksproxyasync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostuf%2Fsocksproxyasync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostuf%2Fsocksproxyasync/lists"}