skillfed

websockets-proxy

Connect to websockets through a proxy server.

websockets-proxy v0.1.3 179.4K downloads/30d#10,173 on PyPI53
Permissive license MIT License Copyright (c) 2023 Andrei Karavatski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) DORMANT released

What it is and what it does

websockets_proxy adds proxy support to the websockets package, allowing you to establish WebSocket connections through HTTP and SOCKS proxies. It wraps the standard websockets connect function with a proxy-aware alternative, delegating proxy handling to python-socks. The package is designed for async/await code and requires creating Proxy objects within an active event loop.

The main use case is routing WebSocket traffic through corporate proxies, anonymization proxies, or other intermediaries. It accepts the same arguments as the standard websockets connect constructor, with added proxy and proxy_conn_timeout parameters. The tradeoff is that you cannot use the sock keyword argument directly, since it is reserved for proxy connection.

Use it for:

  • Route WebSocket connections through corporate HTTP or SOCKS proxies in enterprise environments.
  • Test WebSocket applications against proxy servers to verify proxy compatibility and behavior.
  • Build async clients that need to tunnel WebSocket traffic through intermediary proxies for privacy or network segmentation.
  • Connect to WebSocket APIs from behind restrictive network firewalls that require proxy routing.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Enables WebSocket connections through HTTP and SOCKS proxies by wrapping the websockets package with proxy support via python-socks.

Yes, if you need WebSocket proxy support in an async application. Install friction is low, the license is permissive, and there are no known vulnerabilities. The main caveat is dormancy—643 days without a release—so verify compatibility with your versions of websockets and python-socks before committing. The blocker (Proxy creation inside event loops) is a real constraint but documented and manageable.

Install

websockets-proxy on PyPI

pip

pip install websockets-proxy

uv

uv add websockets-proxy

poetry

poetry add websockets-proxy

Installing websockets-proxy

Before you install

Low install friction with only two runtime dependencies (websockets and python-socks). Maintenance is dormant—last commit was 2024-11-09 and no releases in 643 days—but the package is marked Production/Stable and the repository remains active.

License in practice

MIT License permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

pip install websockets_proxy

from websockets_proxy import Proxy, proxy_connect

proxy = Proxy.from_url("http://user:pass@proxy:port")
async with proxy_connect("wss://example.com", proxy=proxy) as ws:
    msg = await ws.recv()

Proxy objects must be created inside a running event loop (within an async function); creating them outside will raise RuntimeError about task attachment to a different loop.

Verify before relying

  • Whether dormancy (643 days since last release) affects compatibility with recent websockets or python-socks versions.
  • Performance characteristics when routing through various proxy types (HTTP vs SOCKS4 vs SOCKS5).
  • Whether the sock keyword argument restriction impacts real-world use cases.

Package facts

License MIT License Copyright (c) 2023 Andrei Karavatski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 2 — python-socks, websockets
Maintenance dormant — 643 days since the last release
Last repo commit
First released
Downloads 179,389/month — #10,173 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: websockets_proxy-0.1.3-py3-none-any.whl

Keywords: async, http, http proxy, https, socks4, socks5, websocket client, websocket proxy, websockets, websockets proxy, ws, wss

Development Status :: 5 - Production/StableFramework :: AsyncIOIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet :: Proxy ServersTopic :: Internet :: WWW/HTTPTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

websocket proxy clientconnect websockets through proxysocks5 websockethttp proxy websocketasync websocket proxywss proxy connectionwebsocket tunnel proxy
async-networkingproxy-client

More Libraries packages