Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4df25681a | ||
|
|
1e73e96482
|
No files matched your search
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning 2.0.0](https://semver.org/spec/
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- TCP tunnels behind a proxy that sends the PROXY protocol now check the allow list against the real
|
||||||
|
client address. The control connection ignored the address the TLS front already parsed, so
|
||||||
|
`--allow` rules rejected everyone with the proxy's address instead.
|
||||||
|
|
||||||
## [0.3.3] - 2026-11-17
|
## [0.3.3] - 2026-11-17
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -22,8 +22,9 @@ const createControlServer = ({ config, auth, registry, connections, intel, visit
|
|||||||
const forwarded = config.trustProxy && req.headers["x-forwarded-for"]
|
const forwarded = config.trustProxy && req.headers["x-forwarded-for"]
|
||||||
? String(req.headers["x-forwarded-for"]).split(",")[0].trim()
|
? String(req.headers["x-forwarded-for"]).split(",")[0].trim()
|
||||||
: null;
|
: null;
|
||||||
const session = new MuxSession(ws, { parity: 0, name: `cli ${req.socket.remoteAddress}` });
|
const clientIp = req.socket?.frislitIp || forwarded || req.socket.remoteAddress || "";
|
||||||
session.client = { id: randomToken(12), ip: forwarded || req.socket.remoteAddress || "", connectedAt: Date.now() };
|
const session = new MuxSession(ws, { parity: 0, name: `cli ${clientIp}` });
|
||||||
|
session.client = { id: randomToken(12), ip: clientIp, connectedAt: Date.now() };
|
||||||
const headerToken = auth.bearerFromHeaders(req.headers);
|
const headerToken = auth.bearerFromHeaders(req.headers);
|
||||||
let state = "hello";
|
let state = "hello";
|
||||||
let role = null;
|
let role = null;
|
||||||
@@ -84,7 +85,7 @@ const createControlServer = ({ config, auth, registry, connections, intel, visit
|
|||||||
state = "ready";
|
state = "ready";
|
||||||
attachJoiner(tunnel, session, { connections, intel, visitors });
|
attachJoiner(tunnel, session, { connections, intel, visitors });
|
||||||
session.sendControl({ type: "joined", id: tunnel.id, port: tunnel.target.port, online: tunnel.online });
|
session.sendControl({ type: "joined", id: tunnel.id, port: tunnel.target.port, online: tunnel.online });
|
||||||
logger.info(`Joiner attached to ${tunnel.id}`, { from: req.socket.remoteAddress });
|
logger.info(`Joiner attached to ${tunnel.id}`, { from: session.client.ip });
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
fail(session, err.code || "bad_request", err.message);
|
fail(session, err.code || "bad_request", err.message);
|
||||||
|
|||||||
Reference in new issue
Block a user