add support for railway internal proxy
This commit is contained in:
@@ -109,6 +109,11 @@ function isPrivateIp(ip: string): boolean {
|
|||||||
if (v4 === "127.0.0.1" || ip === "::1") return true;
|
if (v4 === "127.0.0.1" || ip === "::1") return true;
|
||||||
if (v4.startsWith("10.")) return true;
|
if (v4.startsWith("10.")) return true;
|
||||||
if (v4.startsWith("192.168.")) return true;
|
if (v4.startsWith("192.168.")) return true;
|
||||||
|
// CGNAT range (RFC 6598) — used by Railway's internal proxy
|
||||||
|
if (v4.startsWith("100.")) {
|
||||||
|
const second = parseInt(v4.split(".")[1] ?? "", 10);
|
||||||
|
if (second >= 64 && second <= 127) return true;
|
||||||
|
}
|
||||||
if (ip.startsWith("fc") || ip.startsWith("fd")) return true;
|
if (ip.startsWith("fc") || ip.startsWith("fd")) return true;
|
||||||
if (v4.startsWith("172.")) {
|
if (v4.startsWith("172.")) {
|
||||||
const second = parseInt(v4.split(".")[1] ?? "", 10);
|
const second = parseInt(v4.split(".")[1] ?? "", 10);
|
||||||
|
|||||||
Reference in New Issue
Block a user