Skip to content
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

Respect QGIS proxy settings #13

Closed
walkermatt opened this issue Feb 2, 2017 · 7 comments
Closed

Respect QGIS proxy settings #13

walkermatt opened this issue Feb 2, 2017 · 7 comments

Comments

@walkermatt
Copy link
Member

Currently the plugin doesn't use the QGIS proxy settings which can cause requests to fail when a proxy server is required.

The plan is to use QgsNetworkAccessManager for requests which should respect the proxy settings.

Testing

Work on the feature appears in the proxy2 branch. To test either download the proxy2 zip and follow the manual installation instructions or clone the repo and checkout the proxy2 branch via git checkout proxy2.

@danblundell
Copy link

Running this as-is I get the following in QGIS error log and no search results, any ideas?

Traceback (most recent call last):
File "/Users/danblundell/.qgis2/python/plugins/gazetteersearch/gazetteers/common.py", line 51, in requestFinished
			    
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py", line 300, in parse_header

parts = _parseparam(';' + line)
TypeError: cannot concatenate 'str' and 'NoneType' objects

@walkermatt
Copy link
Member Author

@danblundell it looks as though the content-type header isn't present. Which gazetteer are you searching? If it's not one of the standard gazetteers can you provide the URL if it's publicly accessible.

@danblundell
Copy link

danblundell commented Feb 9, 2017

@walkermatt all the built in ones (geonames etc) error as does our custom endpoint, if that's it, easy sorted but the example shows Content Type being returned from GeoNames

Example: http://api.geonames.org/search?q=northampton&maxRows=25&style=LONG&lang=en&username=astuntech_qgis_gaz

My python is really limited and I've had a stab myself but just went round in circles!

@walkermatt
Copy link
Member Author

@danblundell have you configured the QGIS proxy settings and if so can you confirm that you are able to connect to other network resources such as adding a WMS layer?

I'll see about adding some more logging so we can more easily see what's happening.

@walkermatt
Copy link
Member Author

@danblundell I've just pushed some changes to the proxy2 branch which log any network errors in the "Gazetteer" Log Messages Panel. Let me know how you get on.

I've heard from another local authority user who was having issues using the Gazetteer behind a corporate proxy and they have been successful once they configured the QGIS proxy settings.

@walkermatt
Copy link
Member Author

FYI I've now seen this version successfully tested within a local authority who had previously experienced issues due to the plugin not respecting proxy settings.

@walkermatt
Copy link
Member Author

These changes have now been merged into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants