-- Leo's gemini proxy

-- Connecting to rkta.srht.site:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

Rene Kita's weblog


Blog[0] About[1] RSS[2] Links[3]


Circumventing Clownflare with w3m


2024-05-03


*Note:* At the time of publishing this article I did not get blocked anymore.


Recently Cloudflare started blocking w3m when visiting any site from the StackExchange network. This was confirmed by multiple users and happened with w3m on Debian, but not with w3m on OpenBSD.


Some debugging showed that curl still worked, so I utilized w3m's siteconf and a CGI script to circumvent the blocking.


The script[4] looks like this:


#!/bin/sh

# Circumvent Clownfare with curl

# Put this file in one of the configured cgi-bin directories of w3m and make
# it executable.
# Add the two next lines your ~/.w3m/siteconf omitting the # at the beginning
#url m!^https?://stackoverflow.com/!
#substitute_url "file:///cgi-bin/anti-cf.cgi?"
#url m!^https?://.*stackexchange.com/!
#substitute_url "file:///cgi-bin/anti-cf.cgi?"

printf "%s\n\n" "Content-Type: text/html"

url=$(echo $W3M_CURRENT_LINK | sed 's@\(http.\{0,1\}://[^/]*\)/.*@\1@')
curl -L ${url}/${QUERY_STRING}

Last modified: 2024-05-03T04:52:52Z


E-mail: mail@rkta.de[5] IRC: #rkta[6] on Libera.Chat[7]

Copyright (c) 2017-2024 Rene Kita


[0] Blog

[1] About

[2] RSS

[3] Links

[4] script

[5] mail@rkta.de

[6] #rkta

[7] Libera.Chat

-- Response ended

-- Page fetched on Mon Jun 3 14:50:12 2024