This is the code used. The error is that Firefox does not use the proxy. Is there another way to specify a proxy sock? Thank you very much for your help.
class post(object):
def firefox(self, proxy,port):
proxy_to_use= proxy + ":" + port
profile = webdriver.FirefoxProfile()
profile.set_preference("network.proxy.type", 1)
profile.set_preference("network.proxy.socks", proxy)
profile.set_preference("network.proxy.socks_port", port)
profile.set_preference("network.proxy.socks_version", 4)
profile.update_preferences()
options = webdriver.FirefoxOptions()
browser = webdriver.Firefox(executable_path = geckodriver, firefox_options = options,firefox_profile=profile)
browser.get("https://ipinfo.io")
browser.quit()