Skip to main content

A library for using HTTP and SOCKS5 proxies with solana clients

Project description

solana-proxy

Telegram channel

A library for using HTTP and SOCKS5 proxies with solana clients The library provides Client and AsyncClient classes, which override the initialization of the original classes. Apart from these two classes, the library does not offer any additional features, and in all other cases, the original solana library, included as part of the installation package, should be used.

pip install solana-proxy

Depencies: solana, httpx, httpx-socks, proxystr

Simple usage

from solana_proxy import Client

RPC_URL = 'https://api.mainnet-beta.solana.com'
client = Client(RPC_URL, proxy='login:password@ip:port')  # or 'socks5://login:password@ip:port'
client.is_connected()
...
client.close()

Client and AsyncClient take proxy in any popular format because they use proxystr lib. Also they take a Proxy obj from that lib.

Context manager

import asyncio
from solana_proxy import Client, AsyncClient

RPC_URL = 'https://api.mainnet-beta.solana.com'
PROXY = 'login:password@ip:port'  # or 'socks5://login:password@ip:port'

with Client(RPC_URL, proxy=PROXY) as client:
    client.is_connected()

async def is_connected():
    async with AsyncClient(RPC_URL, proxy=PROXY) as client:
        return await client.is_connected()

Support

Developed by MrSmith06: telegram | gtihub If you find this project helpful, feel free to leave a tip!

  • EVM address (metamask): 0x6201d7364F01772F8FbDce67A9900d505950aB99

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solana_proxy-0.1.0.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

solana_proxy-0.1.0-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page