Configuring proxies on Python3 + Selenium + Chrome WebDriver

I can’t connect using proxies using Selenium Chrome WebDriver on Python 3.7

When using a proxy (adding -proxy-server=%s), I get the following error:

def selenium_connect():
    PROXY = "66.97.38.58:80"
    url = "http://whatsmyip.org"
    chrome_options = webdriver.ChromeOptions()
    chrome_options.add_argument('--headless')
    chrome_options.add_argument('--no-sandbox')
    chrome_options.add_argument('--disable-dev-shm-usage')
    chrome_options.add_argument('--proxy-server=%s' % PROXY)
    driver = webdriver.Chrome(chrome_options=chrome_options)
    driver.get(url)

This is the error log for the proxy connection:

python3.7/http/client.py”, line 265, in _read_status raise
RemoteDisconnected(“Remote end closed connection without”
http.client.RemoteDisconnected: Remote end closed connection without
response

I’m using a standard ubuntu Docker environment, selenium-3.141.0, chromium-chromedriver 68.0

Source: StackOverflow