fix: Makes passyfire client not whine and complain.
This commit is contained in:
parent
3955b01ede
commit
59f66cbe5b
1 changed files with 7 additions and 6 deletions
|
@ -121,8 +121,6 @@ export function route(instance: PassyFireBackendProvider) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, async (req, res) => {
|
}, async (req, res) => {
|
||||||
console.log(req.hostname);
|
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const body: {
|
const body: {
|
||||||
token: string
|
token: string
|
||||||
|
@ -134,28 +132,31 @@ export function route(instance: PassyFireBackendProvider) {
|
||||||
error: "Invalid token"
|
error: "Invalid token"
|
||||||
});
|
});
|
||||||
|
|
||||||
const host = req.hostname.substring(0, req.hostname.indexOf(":"));
|
// const host = req.hostname.substring(0, req.hostname.indexOf(":"));
|
||||||
const unparsedPort = req.hostname.substring(req.hostname.indexOf(":") + 1);
|
const unparsedPort = req.hostname.substring(req.hostname.indexOf(":") + 1);
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
// parseInt(...) can take a number just fine, at least in Node.JS
|
// parseInt(...) can take a number just fine, at least in Node.JS
|
||||||
const port = parseInt(unparsedPort == "" ? proxiedPort : unparsedPort);
|
const port = parseInt(unparsedPort == "" ? proxiedPort : unparsedPort);
|
||||||
|
|
||||||
|
// This protocol is so confusing. I'm sorry.
|
||||||
res.send({
|
res.send({
|
||||||
success: true,
|
success: true,
|
||||||
data: instance.proxies.map((proxy) => ({
|
data: instance.proxies.map((proxy) => ({
|
||||||
proxyUrlSettings: {
|
proxyUrlSettings: {
|
||||||
host,
|
host: "sameAs", // Makes pfC work (this is by design apparently)
|
||||||
port,
|
port,
|
||||||
protocol: proxy.protocol.toUpperCase()
|
protocol: proxy.protocol.toUpperCase()
|
||||||
},
|
},
|
||||||
|
|
||||||
dest: `${proxy.sourceIP}:${proxy.sourcePort}`,
|
dest: `${proxy.sourceIP}:${proxy.destPort}`,
|
||||||
name: `${proxy.protocol.toUpperCase()} on ::${proxy.sourcePort}`,
|
name: `${proxy.protocol.toUpperCase()} on ::${proxy.sourcePort} -> ::${proxy.destPort}`,
|
||||||
|
|
||||||
passwords: [
|
passwords: [
|
||||||
proxy.userConfig[userData.username]
|
proxy.userConfig[userData.username]
|
||||||
],
|
],
|
||||||
|
|
||||||
|
running: true
|
||||||
}))
|
}))
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue