{"action":"created","issue":{"url":"https://api.github.com/repos/bulkan/robotframework-requests/issues/40","labels_url":"https://api.github.com/repos/bulkan/robotframework-requests/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/bulkan/robotframework-requests/issues/40/comments","events_url":"https://api.github.com/repos/bulkan/robotframework-requests/issues/40/events","html_url":"https://github.com/bulkan/robotframework-requests/issues/40","id":42857456,"number":40,"title":"Not working with authenticating Proxy","user":{"login":"yahman72","id":8724383,"avatar_url":"https://avatars.githubusercontent.com/u/8724383?v=3","gravatar_id":"","url":"https://api.github.com/users/yahman72","html_url":"https://github.com/yahman72","followers_url":"https://api.github.com/users/yahman72/followers","following_url":"https://api.github.com/users/yahman72/following{/other_user}","gists_url":"https://api.github.com/users/yahman72/gists{/gist_id}","starred_url":"https://api.github.com/users/yahman72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahman72/subscriptions","organizations_url":"https://api.github.com/users/yahman72/orgs","repos_url":"https://api.github.com/users/yahman72/repos","events_url":"https://api.github.com/users/yahman72/events{/privacy}","received_events_url":"https://api.github.com/users/yahman72/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bulkan/robotframework-requests/labels/accepted","name":"accepted","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-09-16T08:45:17Z","updated_at":"2016-01-04T15:21:25Z","closed_at":null,"body":"The RequestsLibrary doesn't work at all behind an authenticating proxy.\r\nThe \"proxies\" setting parameter seems to be ignored.\r\n\r\nThe GET request is sent directly to the target host, instead of the proxy host\r\nSee the \"Starting new HTTP connection\" entry in the debug log\r\n\r\n<pre>\r\ndebug log:\r\n==============================================================================\r\n20140916 10:32:15.811 - INFO - +- START TEST: Get Ext Requests [ ]\r\n------------------------------------------------------------------------------\r\n20140916 10:32:15.811 - INFO - +-- START KW: RequestsLibrary.Create Session [ google | http://www.google.com | proxies= {\"http\": \"http://myuser:mypwd@my.proxy.com\"} ]\r\n20140916 10:32:15.812 - DEBUG - Creating session: google\r\n20140916 10:32:15.818 - INFO - Argument types are:\r\n<type 'bool'>\r\n20140916 10:32:15.819 - INFO - +-- END KW: RequestsLibrary.Create Session (8)\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n20140916 10:32:15.819 - INFO - +-- START KW: ${resp} = RequestsLibrary.Get [ google | / ]\r\n20140916 10:32:16.021 - INFO - Starting new HTTP connection (1): www.google.com\r\n20140916 10:34:22.022 - FAIL - ConnectionError: ('Connection aborted.', error(10060, 'A connection attempt failed because the connected party did not properly respond after a perio\r\nd of time, or established connection failed because connected host has failed to respond'))\r\n20140916 10:34:22.022 - DEBUG - Traceback (most recent call last):\r\n  File \"c:\\Python27\\lib\\site-packages\\RequestsLibrary\\keywords.py\", line 111, in get\r\n    response = self.get_request(session, uri, headers, params)\r\n  File \"c:\\Python27\\lib\\site-packages\\RequestsLibrary\\keywords.py\", line 217, in get_request\r\n    cookies=self.cookies, timeout=self.timeout)\r\n  File \"c:\\Python27\\lib\\site-packages\\requests\\sessions.py\", line 463, in get\r\n    return self.request('GET', url, **kwargs)\r\n  File \"c:\\Python27\\lib\\site-packages\\requests\\sessions.py\", line 451, in request\r\n    resp = self.send(prep, **send_kwargs)\r\n  File \"c:\\Python27\\lib\\site-packages\\requests\\sessions.py\", line 557, in send\r\n    r = adapter.send(request, **kwargs)\r\n  File \"c:\\Python27\\lib\\site-packages\\requests\\adapters.py\", line 407, in send\r\n    raise ConnectionError(err, request=request)\r\n20140916 10:34:22.024 - INFO - +-- END KW: ${resp} = RequestsLibrary.Get (126204)\r\n------------------------------------------------------------------------------\r\n20140916 10:34:22.031 - INFO - +- END TEST: Get Ext Requests (126214)\r\n------------------------------------------------------------------------------\r\n\r\nExecution output:\r\n==============================================================================\r\nGet Ext Requests                                                      | FAIL |\r\nConnectionError: ('Connection aborted.', error(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))\r\n------------------------------------------------------------------------------\r\nJson                                                                  | FAIL |\r\n1 critical test, 0 passed, 1 failed\r\n1 test total, 0 passed, 1 failed\r\n==============================================================================\r\n\r\n\r\nMy env - Windows 7:\r\n> pip list\r\ncertifi (14.05.14)\r\nchardet (2.2.1)\r\ncontextdecorator (0.10.0)\r\npip (1.5.6)\r\nPyYAML (3.11)\r\nrequests (2.4.1)\r\nrobotframework (2.8.5)\r\nrobotframework-requests (0.3.7)\r\nsetuptools (5.7)\r\nsix (1.8.0)\r\nvcrpy (1.0.3)\r\n> python -V\r\nPython 2.7.8\r\n\r\nTest case steps:\r\n    Create Session  google  http://www.google.com       proxies= {\"http\": \"http://myuser:mypwd@my.proxy.com\"}\r\n    ${resp}=        Get     google                      /\r\n    Should Be Equal As Strings                          ${resp.status_code}     200 \r\n \r\n</pre>\r\n\r\n###################################################################################\r\n\r\nI also have a RequestsLibrary running with Jython (2.5.3), and because of v2.5 compatibility I had to use very old libs (requests v0.10.0) and there I got it working (after hacking the requests lib a bit) - The above debug log entries look like this:\r\n\r\nNOTE: Here the \"Starting new HTTP connection\" shows the proxy host\r\n<pre>\r\n20140916 10:20:33.652 - INFO - +-- START TEST: Get Ext Requests [ ]\r\n------------------------------------------------------------------------------\r\n20140916 10:20:33.654 - INFO - +--- START KW: RequestsLibrary.Create Session [ google | http://www.google.com | proxies= {\"http\": \"http://myuser:mypwd@my.proxy.com\"} ]\r\n20140916 10:20:33.656 - DEBUG - Creating session: google\r\n20140916 10:20:33.657 - INFO - Argument types are:\r\n<type 'bool'>\r\n20140916 10:20:33.658 - INFO - +--- END KW: RequestsLibrary.Create Session (5)\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n20140916 10:20:33.660 - INFO - +--- START KW: ${resp} = RequestsLibrary.Get [ google | / ]\r\n20140916 10:20:33.666 - INFO - Starting new HTTP connection (1): my.proxy.com\r\n20140916 10:20:38.570 - INFO - Starting new HTTP connection (1): my.proxy.com\r\n20140916 10:20:38.909 - INFO - ${resp} = <Response [200]>\r\n20140916 10:20:38.910 - INFO - +--- END KW: ${resp} = RequestsLibrary.Get (5249)\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n20140916 10:20:38.912 - INFO - +--- START KW: BuiltIn.Should Be Equal As Strings [ ${resp.status_code} | 200 ]\r\n20140916 10:20:38.914 - INFO - Argument types are:\r\n<type 'int'>\r\n<type 'unicode'>\r\n20140916 10:20:38.916 - INFO - +--- END KW: BuiltIn.Should Be Equal As Strings (4)\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n</pre>\r\n"},"comment":{"url":"https://api.github.com/repos/bulkan/robotframework-requests/issues/comments/168704390","html_url":"https://github.com/bulkan/robotframework-requests/issues/40#issuecomment-168704390","issue_url":"https://api.github.com/repos/bulkan/robotframework-requests/issues/40","id":168704390,"user":{"login":"yahman72","id":8724383,"avatar_url":"https://avatars.githubusercontent.com/u/8724383?v=3","gravatar_id":"","url":"https://api.github.com/users/yahman72","html_url":"https://github.com/yahman72","followers_url":"https://api.github.com/users/yahman72/followers","following_url":"https://api.github.com/users/yahman72/following{/other_user}","gists_url":"https://api.github.com/users/yahman72/gists{/gist_id}","starred_url":"https://api.github.com/users/yahman72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahman72/subscriptions","organizations_url":"https://api.github.com/users/yahman72/orgs","repos_url":"https://api.github.com/users/yahman72/repos","events_url":"https://api.github.com/users/yahman72/events{/privacy}","received_events_url":"https://api.github.com/users/yahman72/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T15:21:25Z","updated_at":"2016-01-04T15:21:25Z","body":"Unfortunately I'm not anymore behind an authenticating proxy = I cannot test this.\r\n\r\nActually your example code doesn't test the issue at all:\r\nas I wrote: `The \"proxies\" setting parameter seems to be ignored.The GET request is sent directly to the target host, instead of the proxy host`\r\ni.e. in your example the request is sent directly to \"http://www.google.com\", if it would be sent to the proxy it would fail, because \"http://drive.google.com\" is not a proxy. \r\nIn another words you could put anything in the `proxies` variable e.g. `${proxies} =    Evaluate    {\"http\": \"http://not:existing@not.existing.host.com\"}` and it would still work...\r\n\r\nIMHO: Your really should test with an authenticating proxy, not with dummy google hosts.\r\nIf you don't have an authenticating proxy in your company then \r\n1) set up your own (e.g. you might get http://www.squid-cache.org/ working on your own PC as authenticating proxy)\r\nor\r\n2) trace the HTTP traffic with wireshark and verify that the requests are really sent to the proxy first."}}