Skip to main content

No project description provided

Project description

Python proxy-server lib

Can be used in cases when it is required to connect from white-ip server go grey-ip client. In fact, the websocket connection is initiated by client and then it is kept alive until program/container is stopped. Any data passed in binary format to client is redirected to server and vice versa. There are two possible options to use this lib: via running separate containers and via importing it from python.

Option with separate containers

  1. Create Dockerfiles from the following two files with the same config
  2. Run container with client_side.py on a client machine
  3. Run container with server_side.py on a server machine
from proxy_connector.connection_config import ConnectionConfig

config = ConnectionConfig(remote_proxy_ip=<ip of a server>, 
                          remote_listen_port=<server listen port>, 
                          remote_forward_port=<internal proxy port>,
                          local_proxy_ip=<ip of a client>,
                          local_forward_port=<client listen port>,
                          local_source_port=<port within container>)

# example
config = ConnectionConfig(remote_proxy_ip="192.168.1.34", 
                          remote_listen_port=4805, 
                          remote_forward_port=61842,
                          local_proxy_ip="192.168.1.34",
                          local_forward_port=8008,
                          local_source_port=12215)

client_side.py

from time import sleep
import threading

from proxy_connector.local_client import ProxyClient
# import config

server = ProxyClient(config)

main_thread = threading.Thread(target=server.start_client)
main_thread.start()
# do something
server.stop_server()
main_thread.join()

server_side.py

from time import sleep
import threading

from proxy_connector.remote_proxy import ProxyServer
# import config

server = ProxyServer(config)

main_thread = threading.Thread(target=server.start_server)
main_thread.start()
# do something
server.stop_server()
main_thread.join()

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

proxy_connector-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

proxy_connector-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file proxy_connector-0.1.0.tar.gz.

File metadata

  • Download URL: proxy_connector-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for proxy_connector-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8d71033793e3f72f66b480ea30255f6b42e13a369e30b47c26d03b9eed468925
MD5 e9007ef1d7560b7683502668721e13fc
BLAKE2b-256 7aad6d081525342f5f1178e575c063d208fbec6a4ac1d63992839c4f04fef518

See more details on using hashes here.

Provenance

The following attestation bundles were made for proxy_connector-0.1.0.tar.gz:

Publisher: python-publish.yml on technomaticsDevTeam/proxy-connector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file proxy_connector-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for proxy_connector-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f76fa54b525ebcb321227bb0e4925402165a4d40a0ec81a487875ca1dcb72173
MD5 e57e31e5f2e35300ebad46bd0e88f39a
BLAKE2b-256 0cd3ef625c42b2a0c44796b5c2de014c8251c8aaaebcae426678786e8d3caacb

See more details on using hashes here.

Provenance

The following attestation bundles were made for proxy_connector-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on technomaticsDevTeam/proxy-connector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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