{"action":"created","issue":{"url":"https://api.github.com/repos/googledrive/PyDrive/issues/109","repository_url":"https://api.github.com/repos/googledrive/PyDrive","labels_url":"https://api.github.com/repos/googledrive/PyDrive/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/googledrive/PyDrive/issues/109/comments","events_url":"https://api.github.com/repos/googledrive/PyDrive/issues/109/events","html_url":"https://github.com/googledrive/PyDrive/issues/109","id":250893320,"number":109,"title":"Can we use proxy to access google drive ?","user":{"login":"karamjaber","id":17604541,"avatar_url":"https://avatars0.githubusercontent.com/u/17604541?v=4","gravatar_id":"","url":"https://api.github.com/users/karamjaber","html_url":"https://github.com/karamjaber","followers_url":"https://api.github.com/users/karamjaber/followers","following_url":"https://api.github.com/users/karamjaber/following{/other_user}","gists_url":"https://api.github.com/users/karamjaber/gists{/gist_id}","starred_url":"https://api.github.com/users/karamjaber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karamjaber/subscriptions","organizations_url":"https://api.github.com/users/karamjaber/orgs","repos_url":"https://api.github.com/users/karamjaber/repos","events_url":"https://api.github.com/users/karamjaber/events{/privacy}","received_events_url":"https://api.github.com/users/karamjaber/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-08-17T10:09:17Z","updated_at":"2017-08-24T08:58:58Z","closed_at":null,"body":"I want to use the pydrive with proxy.\r\nIs it supported by pyDrive ?\r\nThe below example doesn't work because i need a proxy connection with googleAuth:\r\n\r\n```\r\nfrom pydrive.drive import GoogleDrive\r\n\r\ndrive = GoogleDrive(gauth)\r\n\r\nfile1 = drive.CreateFile({'title': 'Hello.txt'})  # Create GoogleDriveFile instance with title 'Hello.txt'.\r\nfile1.SetContentString('Hello World!') # Set content of the file from given string.\r\nfile1.Upload()\r\n```"},"comment":{"url":"https://api.github.com/repos/googledrive/PyDrive/issues/comments/324576657","html_url":"https://github.com/googledrive/PyDrive/issues/109#issuecomment-324576657","issue_url":"https://api.github.com/repos/googledrive/PyDrive/issues/109","id":324576657,"user":{"login":"karamjaber","id":17604541,"avatar_url":"https://avatars0.githubusercontent.com/u/17604541?v=4","gravatar_id":"","url":"https://api.github.com/users/karamjaber","html_url":"https://github.com/karamjaber","followers_url":"https://api.github.com/users/karamjaber/followers","following_url":"https://api.github.com/users/karamjaber/following{/other_user}","gists_url":"https://api.github.com/users/karamjaber/gists{/gist_id}","starred_url":"https://api.github.com/users/karamjaber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karamjaber/subscriptions","organizations_url":"https://api.github.com/users/karamjaber/orgs","repos_url":"https://api.github.com/users/karamjaber/repos","events_url":"https://api.github.com/users/karamjaber/events{/privacy}","received_events_url":"https://api.github.com/users/karamjaber/received_events","type":"User","site_admin":false},"created_at":"2017-08-24T08:58:58Z","updated_at":"2017-08-24T08:58:58Z","body":"It seems like that defining a proxy with httplib2 is not working, the code that i run is :\r\n```\r\nfrom pydrive.drive import GoogleDrive\r\nfrom pydrive.auth import GoogleAuth\r\n\r\nimport httplib2\r\n# from httplib2 import socks\r\n\r\n# Create proxied http object (taken from StackOverflow answer).\r\nhttp = httplib2.Http(proxy_info = httplib2.ProxyInfo(3,myProxy, myPort))\r\ngauth = GoogleAuth()\r\ngauth.http = httplib2.Http(proxy_info = httplib2.ProxyInfo(3,myProxy, myPort))\r\nprint(9)\r\ngauth.LocalWebserverAuth()\r\n# Setup drive.\r\nprint(10)\r\ndrive = GoogleDrive(gauth)\r\n\r\n# Setup file object.\r\nprint(1)\r\nfile1 = drive.CreateFile({'title': 'Hello.txt'})  # Create GoogleDriveFile instance with title 'Hello.txt'.\r\nfile1.SetContentString('Hello World!') # Set content of the file from given string.\r\nprint(2)\r\n# Upload file using the proxied http connection.\r\nfile1.Upload(param={\"http\": http})\r\n```\r\nThe expected behaviour is that after this code had run , a file with the name Hello.txt and content Hello word will be uploaded to google drive but the above code just prints 9 and then opens the browser for authentication.\r\nafter manually authenticating an error message appears :\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"Tiota.py\", line 12, in <module>\r\n    gauth.LocalWebserverAuth()\r\n  File \"C:\\PYTHON35\\lib\\site-packages\\pydrive\\auth.py\", line 125, in _decorated\r\n    self.Auth(code)\r\n  File \"C:\\PYTHON35\\lib\\site-packages\\pydrive\\auth.py\", line 495, in Auth\r\n    self.Authenticate(code)\r\n  File \"C:\\PYTHON35\\lib\\site-packages\\pydrive\\auth.py\", line 508, in Authenticat\r\ne\r\n    self.credentials = self.flow.step2_exchange(code)\r\n  File \"C:\\PYTHON35\\lib\\site-packages\\oauth2client\\_helpers.py\", line 133, in po\r\nsitional_wrapper\r\n    return wrapped(*args, **kwargs)\r\n  File \"C:\\PYTHON35\\lib\\site-packages\\oauth2client\\client.py\", line 2054, in ste\r\np2_exchange\r\n    http, self.token_uri, method='POST', body=body, headers=headers)\r\n  File \"C:\\PYTHON35\\lib\\site-packages\\oauth2client\\transport.py\", line 282, in r\r\nequest\r\n    connection_type=connection_type)\r\n  File \"C:\\PYTHON35\\lib\\site-packages\\httplib2\\__init__.py\", line 1322, in reque\r\nst\r\n    (response, content) = self._request(conn, authority, uri, request_uri, metho\r\nd, body, headers, redirections, cachekey)\r\n  File \"C:\\PYTHON35\\lib\\site-packages\\httplib2\\__init__.py\", line 1072, in _requ\r\nest\r\n    (response, content) = self._conn_request(conn, request_uri, method, body, he\r\naders)\r\n  File \"C:\\PYTHON35\\lib\\site-packages\\httplib2\\__init__.py\", line 995, in _conn_\r\nrequest\r\n    conn.connect()\r\n  File \"C:\\PYTHON35\\lib\\http\\client.py\", line 1252, in connect\r\n    super().connect()\r\n  File \"C:\\PYTHON35\\lib\\http\\client.py\", line 849, in connect\r\n    (self.host,self.port), self.timeout, self.source_address)\r\n  File \"C:\\PYTHON35\\lib\\socket.py\", line 711, in create_connection\r\n    raise err\r\n  File \"C:\\PYTHON35\\lib\\socket.py\", line 702, in create_connection\r\n    sock.connect(sa)\r\nTimeoutError: [WinError 10060] A connection attempt failed because the connected\r\n party did not properly respond after a period of time, or established connectio\r\nn failed because connected host has failed to respond\r\n\r\n```\r\n"}}
{"actor":{"display_login":"karamjaber"}}