File: descriptor_from_tor_control_socket.py

package info (click to toggle)
python-stem 1.8.1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,152 kB
  • sloc: python: 33,747; java: 312; makefile: 124; sh: 14
file content (7 lines) | stat: -rw-r--r-- 238 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
from stem.control import Controller

with Controller.from_port(port = 9051) as controller:
  controller.authenticate()

  for desc in controller.get_network_statuses():
    print("found relay %s (%s)" % (desc.nickname, desc.fingerprint))