{"id":13775656,"url":"https://github.com/meejah/txtorcon","last_synced_at":"2025-04-08T09:07:20.589Z","repository":{"id":2848393,"uuid":"3852351","full_name":"meejah/txtorcon","owner":"meejah","description":"Twisted-based asynchronous Tor control protocol implementation. Includes unit-tests, examples, state-tracking code and configuration abstraction.","archived":false,"fork":false,"pushed_at":"2024-03-13T22:37:50.000Z","size":4063,"stargazers_count":247,"open_issues_count":46,"forks_count":71,"subscribers_count":27,"default_branch":"main","last_synced_at":"2024-04-16T03:51:31.472Z","etag":null,"topics":["async","async-programming","privacy","python","tor","twisted"],"latest_commit_sha":null,"homepage":"http://fjblvrw2jrxnhtg67qpbzi45r7ofojaoo3orzykesly2j3c2m3htapid.onion/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"wonderpl/s3yum-updater","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meejah.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2012-03-28T06:51:27.000Z","updated_at":"2024-04-23T19:06:13.221Z","dependencies_parsed_at":"2024-03-13T23:30:55.465Z","dependency_job_id":"8c3a8e0a-8fd1-45bf-b1e7-6c41bd6c69a2","html_url":"https://github.com/meejah/txtorcon","commit_stats":{"total_commits":1635,"total_committers":31,"mean_commits":52.74193548387097,"dds":"0.12721712538226304","last_synced_commit":"c950149bf273f5bd27f254e9a1931c5fcfad3373"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meejah%2Ftxtorcon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meejah%2Ftxtorcon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meejah%2Ftxtorcon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meejah%2Ftxtorcon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meejah","download_url":"https://codeload.github.com/meejah/txtorcon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247809964,"owners_count":20999816,"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","async-programming","privacy","python","tor","twisted"],"created_at":"2024-08-03T17:01:44.988Z","updated_at":"2025-04-08T09:07:20.566Z","avatar_url":"https://github.com/meejah.png","language":"Python","funding_links":[],"categories":["\u003ca id=\"6e80463404d46f0493cf6e84597e4b5c\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"e99ba5f3de02f68412b13ca718a0afb6\"\u003e\u003c/a\u003eTor\u0026\u0026\u0026Onion\u0026\u0026洋葱"],"readme":"\n\n\n\n\n.. _NOTE: see docs/index.rst for the starting-point\n.. _ALSO: https://txtorcon.readthedocs.org for rendered docs\n\n\n\n\n\n\n.. image:: https://github.com/meejah/txtorcon/actions/workflows/python3.yaml/badge.svg\n    :target: https://github.com/meejah/txtorcon/actions\n    :alt: github-actions\n\n.. image:: https://coveralls.io/repos/meejah/txtorcon/badge.png?branch=main\n    :target: https://coveralls.io/github/meejah/txtorcon?branch=main\n    :alt: coveralls\n\n.. image:: https://codecov.io/github/meejah/txtorcon/coverage.svg?branch=main\n    :target: https://codecov.io/github/meejah/txtorcon?branch=main\n    :alt: codecov\n\n.. image:: https://readthedocs.org/projects/txtorcon/badge/?version=stable\n    :target: https://txtorcon.readthedocs.io/en/stable\n    :alt: ReadTheDocs\n\n.. image:: https://readthedocs.org/projects/txtorcon/badge/?version=latest\n    :target: https://txtorcon.readthedocs.io/en/latest\n    :alt: ReadTheDocs\n\n\ntxtorcon\n========\n\n- **docs**: https://txtorcon.readthedocs.org or http://fjblvrw2jrxnhtg67qpbzi45r7ofojaoo3orzykesly2j3c2m3htapid.onion/\n- **code**: https://github.com/meejah/txtorcon\n- ``torsocks git clone git://fjblvrw2jrxnhtg67qpbzi45r7ofojaoo3orzykesly2j3c2m3htapid.onion/txtorcon.git``\n- MIT-licensed;\n- Python 3.8+, PyPy 7.3.7+;\n- depends on\n  `Twisted`_,\n  `Automat \u003chttps://github.com/glyph/automat\u003e`_\n\n\nTen Thousand Feet\n-----------------\n\ntxtorcon is an implementation of the `control-spec\n\u003chttps://gitweb.torproject.org/torspec.git/blob/HEAD:/control-spec.txt\u003e`_\nfor `Tor \u003chttps://www.torproject.org/\u003e`_ using the `Twisted`_\nnetworking library for `Python \u003chttp://python.org/\u003e`_.\n\nThis is useful for writing utilities to control or make use of Tor in\nevent-based Python programs. If your Twisted program supports\nendpoints (like ``twistd`` does) your server or client can make use of\nTor immediately, with no code changes. Start your own Tor or connect\nto one and get live stream, circuit, relay updates; read and change\nconfig; monitor events; build circuits; create onion services;\netcetera (`ReadTheDocs \u003chttps://txtorcon.readthedocs.org\u003e`_).\n\n\nSome Possibly Motivational Example Code\n---------------------------------------\n\n`download \u003cexamples/readme.py\u003e`_\n\n.. code:: python\n\n    from twisted.internet.task import react\n    from twisted.internet.defer import inlineCallbacks, ensureDeferred\n    from twisted.internet.endpoints import UNIXClientEndpoint\n\n    import treq\n    import txtorcon\n\n\n    async def main(reactor):\n        tor = await txtorcon.connect(\n            reactor,\n            UNIXClientEndpoint(reactor, \"/var/run/tor/control\")\n        )\n\n        print(\"Connected to Tor version {}\".format(tor.version))\n\n        url = u'https://www.torproject.org:443'\n        print(u\"Downloading {}\".format(repr(url)))\n        resp = await treq.get(url, agent=tor.web_agent())\n\n        print(u\"   {} bytes\".format(resp.length))\n        data = await resp.text()\n        print(u\"Got {} bytes:\\n{}\\n[...]{}\".format(\n            len(data),\n            data[:120],\n            data[-120:],\n        ))\n\n        print(u\"Creating a circuit\")\n        state = await tor.create_state()\n        circ = await state.build_circuit()\n        await circ.when_built()\n        print(u\"  path: {}\".format(\" -\u003e \".join([r.ip for r in circ.path])))\n\n        print(u\"Downloading meejah's public key via above circuit...\")\n        config = await tor.get_config()\n        resp = await treq.get(\n            u'https://meejah.ca/meejah.asc',\n            agent=circ.web_agent(reactor, config.socks_endpoint(reactor)),\n        )\n        data = await resp.text()\n        print(data)\n\n\n    @react\n    def _main(reactor):\n        return ensureDeferred(main(reactor))\n\n\n\nTry It Now On Debian/Ubuntu\n---------------------------\n\nFor example, serve some files via an onion service (*aka* hidden\nservice):\n\n.. code-block:: shell-session\n\n    $ sudo apt-get install --install-suggests python3-txtorcon\n    $ twistd -n web --port \"onion:80\" --path ~/public_html\n\n\nRead More\n---------\n\nAll the documentation starts `in docs/index.rst\n\u003cdocs/index.rst\u003e`_. Also hosted at `txtorcon.rtfd.org\n\u003chttps://txtorcon.readthedocs.io/en/latest/\u003e`_.\n\nYou'll want to start with `the introductions \u003cdocs/introduction.rst\u003e`_ (`hosted at RTD\n\u003chttps://txtorcon.readthedocs.org/en/latest/introduction.html\u003e`_).\n\n.. _Twisted: https://twistedmatrix.com/trac\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeejah%2Ftxtorcon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeejah%2Ftxtorcon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeejah%2Ftxtorcon/lists"}