Commit graph

9 commits

Author SHA1 Message Date
ddvk
ad06c390bb fix build 2024-10-07 14:05:44 +02:00
ddvk
743a38c344 rename binary to rmfakecloud-proxy 2024-09-26 20:54:33 +02:00
ddvk
3c2bac1b29 add doc for config 2021-09-27 00:26:42 +02:00
Mattéo Delabre
9ef79c874c
Rewrite the Host header in forwarded requests
The default httputil.NewSingleHostReverseProxy implementation does not rewrite the Host header in forwarded requests. So, the upstream server receives requests with the Host header set as the original reMarkable domain. In where a reverse proxy is used in front of rmfakecloud (as suggested [here](https://github.com/ddvk/rmfakecloud/blob/master/docs/https.md)), this can make the HTTP server confused especially if it is configured to serve several websites (in which case the Host header is used to differentiate requests).

This PR replaces the call to NewSingleHostReverseProxy with an implementation that rewrites the Host header (by assigning `req.Host`). This is essentially a copy/paste of the [original implementation](https://cs.opensource.google/go/go/+/refs/tags/go1.17.1:src/net/http/httputil/reverseproxy.go;drc=b7a85e0003cedb1b48a1fd3ae5b746ec6330102e;l=143) but with a new line added that does the rewrite. I don’t know if there’s a cleaner way to do this, and this may introduce licensing issues since the original source is BSD-licensed.
2021-09-26 19:43:03 +02:00
ddvk
8e3defba48 add more hosts 2021-03-21 10:18:07 +01:00
ddvk
84e6627f47 add make file 2021-02-09 17:39:44 +01:00
Jiayu Yi
bf3e053367
Add -version flag 2018-08-18 02:04:26 +08:00
Jiayu Yi
b3064f553c
Update usage 2018-08-18 00:05:13 +08:00
Jiayu Yi
704cba197d
Initial commit 2018-08-17 00:39:14 +08:00