-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin isn't working behind proxy #42
Comments
This is certainly something the plugin should support. |
For future reference: evernote/evernote-sdk-python3#6 |
I did some experiments and it would seem that the Evernote library for Python 3 does not support proxies, unlike the one for Python 2. |
@bordaigorl Is there atm any known workaround ? |
@tommarien Not that I know of: I cannot reproduce the issue with the networks available to me. |
@bordaigorl what about using tools like SquidNT and fiddler to check if the code uses the proxy or not ? |
Is there now a possible way to make the plugin work behind proxy for now, even a hard one? |
@zwpaper It would seem that the problem arose only after updating to ST 3065 so a possible workaround would be to downgrade your ST3 version... |
it doesn't work...I have tried 3059 and 3047, neither of them work...looks like the same problem. Both test in Windows and Ubuntu 14.04
|
Hi, I have little knowledge of how python works, put I have have inspected some library's that are sublime plugins. And from what I can see the problem lies within the Evernote API for Python 3.x, not in the Python itself. Why do I think this? I thing u can clearly see this in the Package Control code here: link to Git-Hub Would it be possible to go and look in the thrift library, find where they declare a connection, and inject the desired proxy settings? I would try and do it myself, but don't expect me to make a swift progress, I would have to be learning a new programming language, and time is not on my hand ... Hopefully I am pointing in the right direction and some Python Guru could create a pull request for the Thrift library. My 2 cents, BC |
Too bad there is no easy fix to this. I will try it out at being my work proxy tomorrow, as I imagine it will affects me as well. I just got a pretty awesome evernote/sublime workflow going at home and was hoping to use it at work too. |
@tauren |
@BattoorCjorn So I just got in to work and tried it out. I'm not sure why, but everything seems to work properly and I didn't do anything special. I'm on OSX and have environment variables such as HTTP_PROXY configured properly. |
@tauren |
@BattoorCjorn just to check, what happens if you set the evironment vars locally? |
@bordaigorl So to answer the question, nothing special, and that is because Sublime Text only looks at the SYSTEM defined vars, instead of the SYSTEM + USER DEFINED vars ... This is the same problem I have with applications that use PATH environment variables to locate certain resources ... that never works, and I always need to set the PATH's to the resource files manually in the setting file of plugin itself. |
I see. Thanks for the clarification. Unfortunately I am not very experienced with this aspect. |
No, it won't help becouse the thrift (Phyton 3.x) library used in the evernote API, does not use these settings. The problem is that when they Ported thrift to 3.x, they left proxy support out of it. Constructors THttpClientLets look at the old 2.x implementation of the Thttpclient: class THttpClient(TTransportBase):
"""Http implementation of TTransport base."""
def __init__(
self,
uri_or_host,
port=None,
path=None,
proxy_host=None,
proxy_port=None
):
"""THttpClient supports two different types constructor parameters.
THttpClient(host, port, path) - deprecated
THttpClient(uri)
Only the second supports https."""
"""THttpClient supports proxy
THttpClient(host, port, path, proxy_host, proxy_port) - deprecated
ThttpClient(uri, None, None, proxy_host, proxy_port)""" So if we look at the constructor u can clearly see that in Python 2 support for proxy's was added, and used. Now if u look at the 3.x constructor u notice that support has been teared down: class THttpClient(TTransportBase):
"""Http implementation of TTransport base."""
def __init__(self, uri_or_host, port=None, path=None):
"""THttpClient supports two different types constructor parameters.
THttpClient(host, port, path) - deprecated
THttpClient(uri)
Only the second supports https.
""" So that means even if u would be able to set the environment Where is Thrift Python?
|
@BattoorCjorn yes, I noticed that as well but since THttpClient uses http.client I was wondering if there was a way to just set the http.client proxy setting globally. As for updating Thrift, it would seem you need some sources we do not have from which Thrift generates the library.... |
@bordaigorl There are 4 layers when making http requests, Thttpclient uses http.client uses request uses sockets. The example uses the request layer. And this is what it says about that layer in the docs:
So will it work to set the global opener on the urllib.request.install_opener(opener), and then hope that when a call will be made in the http.client, that proxy will be used ? Pff ...OK so I tried it, apparently the "the default global opener" isn't as global as It's name presumes. I'm |
I would also love to see this problem fixed but I have a workaround to share: |
anybody can fix this problem? |
If you are using sublime text behind a company proxy, you basically have to set the proxy settings per module right to get this module working right now.
I had to set the company proxy for example for the plugin package control in the settings of the package control, because the sublime own proxy settings were ignored (see https://sublime.wbond.net/docs/settings#setting-http_proxy).
The possibility to set custom proxy settings for this module would be nice. For now, the plugin isn't working behind a proxy, even if the .bash_profile of the user or something similar is set up correctly.
The text was updated successfully, but these errors were encountered: