![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Python relay/proxy server and library to build reliable encrypted TCP/UDP tunnels with entropy control for TCP traffic
Python relay/proxy server and library to build reliable encrypted TCP/UDP tunnels with entropy control for TCP traffic
|pypi|
.. |pypi| image:: https://badge.fury.io/py/ouija.svg :target: https://badge.fury.io/py/ouija :alt: pypi version
Hides TCP traffic in encrypted TCP/UDP tunnel between relay and proxy servers
.. image:: https://raw.githubusercontent.com/neurophant/ouija/main/ouija.png :alt: TCP/UDP tunneling :width: 800
.. code-block:: bash
python3.11 -m venv .env
source .env/bin/activate
pip install ouija
Generate cipher_key/token secrets:
.. code-block:: bash
ouija_secret
Run relay/proxy server:
.. code-block:: bash
ouija <config.json>
tcp-relay.json - TCP relay server - HTTP/HTTPS proxy server interface with TCP connectors:
.. code-block:: json
{
"protocol": "TCP",
"mode": "RELAY",
"debug": true,
"monitor": true,
"relay_host": "127.0.0.1",
"relay_port": 9000,
"proxy_host": "127.0.0.1",
"proxy_port": 50000,
"cipher_key": "bdDmN4VexpDvTrs6gw8xTzaFvIBobFg1Cx2McFB1RmI=",
"entropy_rate": 5,
"token": "395f249c-343a-4f92-9129-68c6d83b5f55",
"serving_timeout": 20.0,
"tcp_buffer": 1024,
"tcp_timeout": 1.0,
"message_timeout": 5.0
}
tcp-proxy.json - TCP-relayed proxy server:
.. code-block:: json
{
"protocol": "TCP",
"mode": "PROXY",
"debug": true,
"monitor": true,
"proxy_host": "0.0.0.0",
"proxy_port": 50000,
"cipher_key": "bdDmN4VexpDvTrs6gw8xTzaFvIBobFg1Cx2McFB1RmI=",
"entropy_rate": 5,
"token": "395f249c-343a-4f92-9129-68c6d83b5f55",
"serving_timeout": 20.0,
"tcp_buffer": 1024,
"tcp_timeout": 1.0,
"message_timeout": 5.0
}
udp-relay.json - UDP relay server - HTTP/HTTPS proxy server interface with UDP connectors:
.. code-block:: json
{
"protocol": "UDP",
"mode": "RELAY",
"debug": true,
"monitor": true,
"relay_host": "127.0.0.1",
"relay_port": 9000,
"proxy_host": "127.0.0.1",
"proxy_port": 50000,
"cipher_key": "bdDmN4VexpDvTrs6gw8xTzaFvIBobFg1Cx2McFB1RmI=",
"entropy_rate": 5,
"token": "395f249c-343a-4f92-9129-68c6d83b5f55",
"serving_timeout": 20.0,
"tcp_buffer": 1024,
"tcp_timeout": 1.0,
"udp_min_payload": 512,
"udp_max_payload": 1024,
"udp_timeout": 2.0,
"udp_retries": 5,
"udp_capacity": 10000,
"udp_resend_sleep": 0.25
}
udp-proxy.json - UDP-relayed proxy server:
.. code-block:: json
{
"protocol": "UDP",
"mode": "PROXY",
"debug": true,
"monitor": true,
"proxy_host": "0.0.0.0",
"proxy_port": 50000,
"cipher_key": "bdDmN4VexpDvTrs6gw8xTzaFvIBobFg1Cx2McFB1RmI=",
"entropy_rate": 5,
"token": "395f249c-343a-4f92-9129-68c6d83b5f55",
"serving_timeout": 20.0,
"tcp_buffer": 1024,
"tcp_timeout": 1.0,
"udp_min_payload": 512,
"udp_max_payload": 1024,
"udp_timeout": 2.0,
"udp_retries": 5,
"udp_capacity": 10000,
"udp_resend_sleep": 0.25
}
Relay and proxy setup configuration with supervisord - ouija-config <https://github.com/neurophant/ouija-config>
_
stream-relay.py - TCP relay server - HTTP/HTTPS proxy server interface with TCP connectors:
.. code-block:: python
import asyncio
import logging
from ouija import StreamRelay as Relay, StreamTuning as Tuning, Telemetry, SimpleEntropy, FernetCipher
async def main() -> None:
tuning = Tuning(
cipher=FernetCipher(key='bdDmN4VexpDvTrs6gw8xTzaFvIBobFg1Cx2McFB1RmI='),
entropy=SimpleEntropy(rate=5),
token='395f249c-343a-4f92-9129-68c6d83b5f55',
serving_timeout=20.0,
tcp_buffer=1024,
tcp_timeout=1.0,
message_timeout=5.0,
)
relay = Relay(
telemetry=Telemetry(),
tuning=tuning,
relay_host='127.0.0.1',
relay_port=9000,
proxy_host='127.0.0.1',
proxy_port=50000,
)
asyncio.create_task(relay.debug())
await relay.serve()
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.run_forever()
stream-proxy.py - TCP-relayed proxy server:
.. code-block:: python
import asyncio
import logging
from ouija import StreamProxy as Proxy, Telemetry, StreamTuning as Tuning, SimpleEntropy, FernetCipher
async def main() -> None:
tuning = Tuning(
cipher=FernetCipher(key='bdDmN4VexpDvTrs6gw8xTzaFvIBobFg1Cx2McFB1RmI='),
entropy=SimpleEntropy(rate=5),
token='395f249c-343a-4f92-9129-68c6d83b5f55',
serving_timeout=20.0,
tcp_buffer=1024,
tcp_timeout=1.0,
message_timeout=5.0,
)
proxy = Proxy(
telemetry=Telemetry(),
tuning=tuning,
proxy_host='0.0.0.0',
proxy_port=50000,
)
asyncio.create_task(proxy.debug())
await proxy.serve()
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.run_forever()
datagram-relay.py - UDP relay server - HTTPS proxy server interface with UDP connectors:
.. code-block:: python
import asyncio
import logging
from ouija import DatagramRelay as Relay, DatagramTuning as Tuning, Telemetry, SimpleEntropy, FernetCipher
async def main() -> None:
tuning = Tuning(
cipher=FernetCipher(key='bdDmN4VexpDvTrs6gw8xTzaFvIBobFg1Cx2McFB1RmI='),
entropy=SimpleEntropy(rate=5),
token='395f249c-343a-4f92-9129-68c6d83b5f55',
serving_timeout=20.0,
tcp_buffer=1024,
tcp_timeout=1.0,
udp_min_payload=512,
udp_max_payload=1024,
udp_timeout=2.0,
udp_retries=5,
udp_capacity=10000,
udp_resend_sleep=0.25,
)
relay = Relay(
telemetry=Telemetry(),
tuning=tuning,
relay_host='127.0.0.1',
relay_port=9000,
proxy_host='127.0.0.1',
proxy_port=50000,
)
asyncio.create_task(relay.debug())
await relay.serve()
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.run_forever()
datagram-proxy.py - UDP-relayed proxy server:
.. code-block:: python
import asyncio
import logging
from ouija import DatagramProxy as Proxy, Telemetry, DatagramTuning as Tuning, SimpleEntropy, FernetCipher
async def main() -> None:
tuning = Tuning(
cipher=FernetCipher(key='bdDmN4VexpDvTrs6gw8xTzaFvIBobFg1Cx2McFB1RmI='),
entropy=SimpleEntropy(rate=5),
token='395f249c-343a-4f92-9129-68c6d83b5f55',
serving_timeout=20.0,
tcp_buffer=1024,
tcp_timeout=1.0,
udp_min_payload=512,
udp_max_payload=1024,
udp_timeout=2.0,
udp_retries=5,
udp_capacity=10000,
udp_resend_sleep=0.25,
)
proxy = Proxy(
telemetry=Telemetry(),
tuning=tuning,
proxy_host='0.0.0.0',
proxy_port=50000,
)
asyncio.create_task(proxy.debug())
await proxy.serve()
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.run_forever()
.. code-block:: bash
pytest --cov-report html:htmlcov --cov=ouija tests/
FAQs
Python relay/proxy server and library to build reliable encrypted TCP/UDP tunnels with entropy control for TCP traffic
We found that ouija demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.