New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

trio-socks

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trio-socks

trio-socks provides a trio.abc.HalfCloseableStream that routes its traffic through a SOCKS proxy server

  • 0.1.1.post5
  • PyPI
  • Socket score

Maintainers
1

trio-socks

trio-socks provides a trio.abc.HalfCloseableStream that routes its traffic through a SOCKS proxy server

Example

import trio
from trio_socks import socks5

async def parse_public_ip(stream):
	await stream.send_all('GET / HTTP/1.1\r\nHost: api.ipify.org\r\n\r\n'.encode())
	text = (await stream.receive_some()).decode()
	i = text.rfind('\r\n\r\n')
	my_ip = text[i + 4:]
	print(f'{my_ip=}')

async def print_public_ip():
	async with socks5.Socks5Stream(destination=('api.ipify.org', 80), proxy=('10.179.205.114', 1664)) as stream:
		await parse_public_ip(stream)

	async with await trio.open_tcp_stream('api.ipify.org', 80) as stream:
		await parse_public_ip(stream)

trio.run(print_public_ip)

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc