Cainiao solution-404 error in gappproxy after domain name binding

Source: Internet
Author: User

Two days ago, after Google * .appspot.com was harmonious, gappproxy of many wall friends could not be used, but Gae bound to the domain name could be accessed normally, so I think, you can also use gappproxy by using a custom bound domain name. When I use the latest gappproxy2, I receive the 404 error relentlessly:

Error Response

Error Code 404.

Message: local proxy error, fetchserver not found at the url you specified, please check it ..

Error Code explanation: 404 = nothing matches the given Uri.

However, theoretically, the results of using your own domain name and appspot.com should be the same, but after all, this isProgramSo I decided to see if I couldCodeFind the solution in (I am not familiar with the python syntax to find the root cause of the problem from the code. Is it a bit self-defeating ~ _~, But don't try it out. Isn't that a learning method ?)...

......

Hey, it's really hard to get down to me ~

There is such a piece of code at line 199 of proxy. py:

 
If local_proxy! = "":
Proxy_handler = urllib2.proxyhandler ({"HTTP": local_proxy })
Else:
Proxy_handler = urllib2.proxyhandler (google_proxy)
Opener = urllib2.build _ opener (proxy_handler)
# Set the opener as the default Opener
Urllib2.install _ opener (opener)

In addition, "resp = urllib2.urlopen (request, Params)" is used to open the connection. In this step, the 404 exception is thrown. Of course, this code is not enough to determine the root cause of the error, so I can only find the meaning of the Code step by step (cainiao's helplessness ~).

Finally, use the method name proxyhandler andLocal_proxy: The variable read from the configuration file, conjectureShould the proxyhandler method be used to set proxy? Google, this method is really true, and then passed the testGoogle_proxy variable, in this step:

 Google_proxy = {'http': 'www .google.cn: 80 '}

This makes me wonder. This proxy address is set in common. py.

Google_proxy = 'www .google.cn: 80'

However, it is unknown why Google is used as the proxy address.

After knowing the cause of the error, there will be more solutions... my method is to remove the code in else:

 
If local_proxy! = "":
Proxy_handler = urllib2.proxyhandler ({"HTTP": local_proxy })
Opener = urllib2.build _ opener (proxy_handler)
# Set the opener as the default Opener
Urllib2.install _ opener (opener)

 

That is, these lines of code are not run when no proxy is configured.

Save, run... Everything OK!

Below is my package exebehind proxy.exe, if you use localproxy-2.0.0-win and do not want to package their own, download this:

Http://commondatastorage.googleapis.com/oncereply/myproxy.zip

 

I am a python newbie. This method is only temporary. I hope gappproxy will provide a more perfect method.

Transferred from: Reply

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.