0

I've tried to create a twill test that changes the proxy server settings of 2 different tests. I need to trigger this change in runtime without relaunching the test script.

I've tried to use the "http_proxy" environment variable by setting os.environ["HTTP_PROXY"], but it's only changes the proxy setting for the first test, and does not works on the second and third tests.

Could you please suggest a way to change twill's proxy settings on runtime ?

1 Answers1

0

Set the proxy environment variable before you run the twill script.

sh/ksh/bash

export HTTP_PROXY=blah:8080

csh

setenv HTTP_PROXY blah:8080

It's worth nothing, this should work by setting os.environ['http_proxy'], but it might not if you set it after you import twill. Twill may be checking this once on startup? The only 100% safe way I would imagine is exporting the variable so that all further child processes will get it as their environment.

synthesizerpatel
  • 27,321
  • 5
  • 74
  • 91