-
Notifications
You must be signed in to change notification settings - Fork 777
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
Create proxy handlers for China. #87
Comments
#93 should help here. |
Hello, for anyone who is still interested, I have made an apache configuration that will setup a reverse proxy for Recaptcha using your own server under your domain yourdomain.com/recaptcha -> www.google.com/recaptcha Edit: moved to gist for easier maintenance |
What did you do to I tried to modify the hostnames in those files, but the browser ends up sending request to Thanks in advance |
@tabjy |
unsubcribe
Am 16.02.2017 um 14:39 schrieb Tabjy:
…
@zypA13510 <https://github.com/zypA13510>
What did you do to |https://www.google.com/recaptcha/api.js| and
|https://www.gstatic.com/recaptcha/api2/r20170206171236/recaptcha__en_gb.js|?
I tried to modify the hostnames in those files, but the browser ends
up sending request to
|https://www.google.com/recaptcha/api2/userverify| all the time...
Thanks in advance
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQZcai31aj8aZnSjO4zSgWksf4sc0CAPks5rdFGvgaJpZM4HB-kt>.
--
Rene Ballmann
Software-Engineer
Animate, Agentur für interaktive Medien GmbH
Hertha-Genzmer-Str. 1
65197 Wiesbaden
Fon: +49-611-945808501
Fax: +49-611-36028776
Registergericht: Amtsgericht Wiesbaden
Registernummer: 21 HRB 12737
Geschäftsführer: Philipp Giere, Thomas Elsäßer
http://www.animate.de/
|
@zypA13510
I'm absolute sure that I substituted all domain in |
|
Hello, How do I do this in IIS? |
Hi, I stay trying make it on my Apache server but the recaptcha is not working |
@DarwinSilva |
Hi @zypA13510 ! I followed your steps but doesn't work. changes to <script src="https://mydomain.com/recaptcha/api.js?hl=es" async="async" defer="defer"></script>That's ok. However in the call "https://mydomain.com/recaptcha/api.js?hl=es", the SUBSTITUTE doesn't work. So, it seems that the SUBSTITUTE doesn't work on proxypass .... Any idea? Regards, |
Hi! |
Hello, i tried to apply the idea of @zypA13510 , however i don't have full control to the virtualhosts. but, i have mod_rewrite enabled on my apache. So i wrote a small PHP wrapper, and a .htaccess : .htaccess file
index.php file
Here is how to use it :
(yes, you need to copy each file in two location. You will have 4 files at the end) Just to be clear : this is NOT the best way at all to proxy recaptcha (create a reverse-proxy at apache level is clearly better), however sometimes there is no other choice than doing this |
It seems that a lot of google domain are also accessed: www.google.com,www.gstatic.com,support.google.com,developers.google.com,fonts.gstatic.com I am stuck with https://www.google.com/js/bg/d--b7FVIhvCFHkmSrkgO9rhjbdCimjBfDEqJIwYWYPc.js initiated by recaptche__en.js in which I can't see any "www.google.com" reference. It's like if that url was built by a js function. Do you have any update about your reverse proxy solution? Tkx |
Yes, it is as you said. Requests built from sources other than plain text (e.g. from a binary stream) cannot be detected by SUBSTITUTE. But I tested my solution on a client computer that never visited Google nor used any VPN. Despite a few requests failed, it worked nevertheless and I was able to click the right images to get pass recaptcha (at least at the time of my previous post). However, I have not tested it recently, so I'm afraid I can't help you further. Sorry. One thing about the Chinese Great Firewall is, it is ever-changing and evolving. And of course, its behavior is not, and will never be documented. In other words, it will never be easy, trying to grant access to a website that is not meant to be accessible. 😉 If you find a better solution, you can share it to help more (or I don't mind updating my comment). Good luck. |
Hi! Here is my solution that works. Create two conf on Apache and replace WWW.YOURDOMAIN.COM and YOURDOMAIN.COM with your domain.
<VirtualHost *:80>
|
Hello, does someone has solution for nginx? |
I had trouble with the config you posted on jan 30 until I took a clue from @joinso - it's important to add |
So, now that I implemented this clever hack, I'd like to warn others that it doesn't work very well.
|
You may try
to
in front end, and
to
in back end, and it should work as expected. |
So, I tried using recaptcha.net, but I see it still loads 1 asset from google.com eg, the url that starts with: https://www.google.com/recaptcha/api2/anchor... I tried putting this url into the "test url" tab of https://en.greatfire.org/analyzer but it said it failed to load Is there any official comment from google on this? |
I was able to get this to work. In the page I added:
In Nginx I added (note: this is ERB which compiles to Nginx config):
|
Is this workaround officially "supported"? |
@msegzda "officially"? there is not such concept in China. You need to understand something : when chinese government decide do ban websites, officials just say to chinese ISP "please ban Google", without any clear explanation of what "Google" is. Because of this, chinese ISP do ban websites depending on their interpretation / rendition, which is sometimes subjective. The two main ISP of China (China unicom & china telecom) don't use the same ban list and/or ban depending on the area you are in....so basically, a website could be sometimes accessible and sometimes not, in a chaos which is so representative of China. |
@Augustin-FL thanks for reply. Let me clarify. I don't care about China, its probably wrong place but what I'm asking is what's Google's official standing on community using these reverse-proxy workarounds? As you can see there is number of complex substitutions on Nginx or Apache filters happening in order to remove and replace any Google servers with own domains and endpoints. If reCaptcha sources changes in those parts all of the implementations blows up! So what I want to know - does Google support or back the community doing this workaround and are they + community careful about changing the code that can potentially break all the zillions of websites in China using reCaptcha? |
@sdemjanenko would you mind to update your nginx snippet? Seems like |
I'm updating the client on the |
Reliability of results and user experience if you're going through a proxy is really out of scope for this repo. I've updated the code to allow for setting of an explicit URL and I'm happy to take PRs that add |
@zypA13510 do you do the yourdomain.com/static.yourdomain.com separation simply to avoid filename clashes? I.e if one is feeling lucky and there are no name clashes then one could serve a bunch of domains from within yourdomain.com/recaptcha? |
Another reason is that rewriting path (the part after hostname) in reverse proxy is very troublesome and tends to have undesired result
good luck with that. But personally, I don't think it's the right way to go (unless you are really limited to one domain only and have no other choice) |
Hi Everyone, I have written a reverse proxy solution for our China customers but the problem is the solution is unstable, for example, we have the following issue It takes a user about 8 to 9 verify requests before the users response is accepted within the Recaptcha interface. I receive the following response for the POST to "/recaptcha/api2/userverify?k=xxxx"
If I use google the domain I receive a successful ReCaptcha response within 3 attempts
Basic Curl POST to Google reCAPTCHA Domain (Bypassing Proxy)
Im trying to understand the issue with the response, im wondering if its related to the session, does anyone have any tips or advice how to decode the response to confirm the issue ? |
One can also consider using another captcha service as fallback when reCaptcha fails to load. Here is an example by MTCaptcha: https://www.mtcaptcha.com/faq-recaptcha-fallback-mtcaptcha. MTCaptcha is not free though, it does have a relatively cheaper plan if only need to support traffic in China. Full transparency, I work for MTCaptcha, and its an awesome service :-) |
Hi! I posted a new version of my solution. In /etc/httpd/conf.d/yourdomain.conf:
In ssl.conf:
In /etc/httpd/conf.d/maxmind_geolite2.conf:
In /etc/httpd/conf.d/gstatic.conf:
If your are behind a Proxy: In /etc/httpd/conf.d/remoteip.conf:
As @rwat090 says, the reCatpcha works, load all images, but it takes about 10 test to pass it. Regards, |
@joinso. Maybe it's working fine, and by the tenth pass its simply failing due to a timeout? (from memory the recaptcha client response code needs to be validated server side within 2 minutes or something) @rehfeldchris the original post is a couple years old, but I'd be expecting that Google does this auto switching of dependant JS files out of the box depending on where the request comes from?, otherwise the "recaptcha.net" domain they've offered as an alternative for "International" use cases would be pointless. E.g. for supporting someone in China I don't think Google engineers would be silly enough to ask us on their official site to load the first script via "recaptcha.net", and simply have all subsequent dependant files still loading from "google.com". |
Hi, We are using ALB as the client facing and have Apache reverse proxy in between ALB and application server. Implemented the same solution in Apache reverse proxy without any virtual host. getting js file If I try to access the js file from browser as "http:///recaptcha/api.js". I am getting 404 error when I tried from browser as "https:///recaptcha/api.js". I verified the Apache reverse proxy logs, connection is established with google but getting 404 error from google somehow. Can you please share your thoughts what is going wrong. |
Hi, Can someone throw light on the above issue. appreciate your inputs. |
https://www.gstatic.com |
I don't know where to start this discussion so I will start it here.
China has blocked recaptcha. The service is awesome, so I'd like to attempt to workaround this.
My idea would be this.
What do you guys think? I haven't tried it yet, but does anyone know if there would be any hangups with this approach?
The text was updated successfully, but these errors were encountered: