Skip to main content

Proxy Configuration

HTTP API

The following code demonstrates setting up an HTTPS proxy and actively turning off certificate verification (because the proxy's certificate in the example is self-signed).

Support setting HTTP/HTTPS proxy through environment variables

  1. Set the environment variable HTTP_PROXY
  2. Set the environment variable HTTPS_PROXY
import os
from webullsdkcore.client import ApiClient
from webullsdkcore.common.region import Region

proxy_host = "127.0.0.1"
proxy_port = 8888
# Set the proxy for HTTPS to 127.0.0.1:8888
os.environ['HTTPS_PROXY'] = proxy_host + ":" + str(proxy_port)
# Set verify to False, which means that the certificate provided by the proxy will not be verified
client = ApiClient(app_key="<your_app_key>", app_secret="<your_app_secret>", region_id=Region.JP.value, verify=False)

Trade Events Subscription / Quotes API

Similar to the HTTP API, and it supports setting the proxy through environment variables.

  1. Set the environment variable grpc_proxy
  2. Set the environment variable https_proxy
  3. Set the environment to connect http_proxy

Priority from 1 to 3