Error: no proxy address identified.

Have seen a couple of threads popping up with similar issues related to proxy, this is new to me:

2022-08-25 08:09:58,324 P[19480] [MainThread 10120] Error: no proxy address identified. Check if Eikon Desktop or Eikon API Proxy is running. 

2022-08-25 08:09:58,355 P[19480] [MainThread 10120] Error on handshake url http://127.0.0.1:None/api/handshake : UnsupportedProtocol("Request URL is missing an 'http://' or 'https://' protocol.")

2022-08-25 08:09:58,358 P[19480] [MainThread 10120] Error on handshake url http://127.0.0.1:None/api/handshake : UnsupportedProtocol("Request URL is missing an 'http://' or 'https://' protocol.")

2022-08-25 08:09:58,370 P[19480] [MainThread 10120] Port number was not identified, cannot send any request

2022-08-25 08:09:58,389 P[19480] [MainThread 10120] Eikon Proxy not running or cannot be reached. Please read the documentation on troubleshooting

Have otherwise been using the same code for the past couple of weeks and it has been running without issues. Did Eikon change something?

Appreciate any help, thanks.

Tagged:

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    We checked and found that this issue relates to the proxy setting.

    We need to check the connections by running the following code.

    First, test with the requests library.

    import requests
    url = 'http://127.0.0.1:9060/api/status'
    x = requests.get(url)
    print(x.text)

    Then, test with the httpx library. The Eikon Data API depends on this library.

    import httpx
    timeout = 60
    http_session = httpx.AsyncClient(
                headers={"Accept": "application/json"},
                timeout=timeout,
            )
    request_response = await http_session.request('GET','http://127.0.0.1:9060/api/status')
    request_response.content

    The output is:

    1661833932215.png

    However, in the client's environment, the GET request didn't work. The client can solve the problem by setting a proxy server in the GET request.

    import requests
    url = 'http://127.0.0.1:9060/api/status'
    proxies = {
    'http': '',
    'https': ''
    }
    x = requests.get(url, proxies=proxies)
    print(x.text)

    Therefore, when using Eikon Data API, the client also needs to set a proxy server in the HTTP_PROXY operating system environment variable. For example:

    import eikon as ek
    import os
     
    #ek.set_log_level(1)
    os.environ['HTTP_PROXY']=http://127.0.0.1:8080
    os.environ['HTTPS_PROXY']=http://127.0.0.1:8080
    ek.set_app_key('<app key>')

Answers