Rdr2tls
Haskell web service that redirects all traffic from HTTP to HTTPS
Install / Use
/learn @fpco/Rdr2tlsREADME
RDR2TLS
This Haskell application (& resulting 7MB Docker image) is a minimalist web-server for the single purpose of redirecting to HTTPS. The easiest way to run this application is to use the Docker image on Dockerhub.
docker pull fpco/rdr2tls
docker run -i -t --rm -p 8080:8080 fpco/rdr2tls
This runs the service on port 8080. Any requests HTTP requests to port 8080 get redirected to HTTPS.
% curl -v 'http://localhost:8080/remote/worker?pants=YES'
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /remote/worker?pants=YES HTTP/1.1
> User-Agent: curl/7.38.0
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Transfer-Encoding: chunked
< Date: Wed, 06 May 2015 00:31:16 GMT
* Server Warp/3.0.13 is not blacklisted
< Server: Warp/3.0.13
< Location: https://localhost/remote/worker?pants=YES
<
* Connection #0 to host localhost left intact
Use a different port or domain:
docker run -i -t --rm fpco/rdr2tls rdr2tls --help
docker run -i -t --rm -p 4000:4000 fpco/rdr2tls \
rdr2tls -p 4000 -P mycatchalldomain.com/folder
This would run rdr2tls on port 4000 and redirect all traffic to https://mycatchalldomain.com/folder
Building RDR2TLS
This application is built with Haskell. It was built using GHC 7.8 & Cabal 1.20. Feel free to use other versions if you like. The basic build consists of initiating a cabal sandbox & then installing with cabal.
cabal sandbox init
cabal install
./.cabal-sandbox/bin/rdr2tls --help
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
