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.1.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.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: proxy_connector-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 deaa7606ad8924559098fb967db0b6aedb9dd821685a072bf8edb7871c514f64
MD5 62b843c620c170cad2b1de36e40dfc1f
BLAKE2b-256 e2c189e056d460bbd5853ce82409a2bf48ada22c734d6acf01fe818ade4fc6fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for proxy_connector-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for proxy_connector-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1657d1ea210be5f44d788998ea8bbee36aaa1e7cf8bb806f5bf814e7436e61d1
MD5 1b465be6f12cdf48c55e6aa3b8607e36
BLAKE2b-256 db21ced6c56c18c6cf40e0a338a75ef539eb4a2eb5c99df7227c9f1acb681d03

See more details on using hashes here.

Provenance

The following attestation bundles were made for proxy_connector-0.1.1-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