Skip to main content

Python Package to open socket to SAP Cloud Connector via Connectivity Proxy

Project description

sap-cloud-connector-python-socket

Python Socket to connect to the SAP Cloud Connector via Connectivity Service

The SAP BTP Connectivity Proxy allows to connect to on-prem systems. It can act as a SOCKS5 Proxy to establish TCP connections. Due to its custom authentication scheme one can not use standard SOCKS5 client libaries. For details on how to authenticate against the Connectivity Proxy see the official Documentation. https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/using-tcp-protocol-for-cloud-applications

Sample Usage:

from sapcloudconnectorpythonsocket import CloudConnectorSocket

cc_socket = CloudConnectorSocket()
cc_socket.connect(
    dest_host="virtualhost", 
    dest_port=3333, 
    proxy_host="connectivity-proxy", 
    proxy_port=20003, 
    token="<token>",
    location_id="CLOUD_CONNECTOR_LOCATION_ID"
)

Opens a socket in python using the SAP Cloud Connector as proxy. The standard socket object from python can be used in a various applications. Often times useful in connectig to TCP based protocols using python packages. The LocationId is optional. The destination host and port are the virtualhost and virtualport configured in the Cloud Connector configuration. The proxy_host and the proxy_port are the host and port of the BTP Cloud Foundry Connectivity Proxy. The token is the authentication token to the Connectivity Proxy. They can be obtained from the Credentials of an BTP Connectivity Service instance.

To open a TCP based connection the proxy_port needs to be the port to the socks5 proxy. This is usually 20004 in the connectivity service.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

sapcloudconnectorpythonsocket-0.1.2-py2.py3-none-any.whl (7.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sapcloudconnectorpythonsocket-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sapcloudconnectorpythonsocket-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f3d0fe563cc6c306d6a8effe6dbbf21c08a36aba380f5298e3ff95a11d97fa73
MD5 7ba667978aaa8cafdac741d6d91d5348
BLAKE2b-256 c95e14eda278d52da0c5eeb4d0d1d65540d43dad9308f2c71ec1b6881188a94b

See more details on using hashes here.

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