Commit ba4a1a88 authored by nanahira's avatar nanahira

reverse frps cn score

parent 85a5c654
......@@ -203,7 +203,7 @@ class InventoryBuilder {
//console.log(local.name, name, mtu);
if (outbound) {
console.log(`${local.name} GW ${localGateway.isp} ${inbound ? "<" : "="}==[${protocol}]==> ${remote.name} GW ${remoteGateway.isp}`);
console.log(`${local.name} GW ${localGateway.isp} ${inbound ? "<" : "="}=${frpType === "frps" ? "s" : "="}=[${protocol}]=${frpType === "frpc" ? "s" : "="}=> ${remote.name} GW ${remoteGateway.isp}`);
}
return {
......@@ -233,7 +233,7 @@ class InventoryBuilder {
// frps还是frpc的积分,NAT越有利分越高
gatewayCompareScore(gateway: any): number {
let score: number = 0xff - gateway.id; // 8 bits
const isCNScore = gateway.isCN ? 1 : 0; // 1 bit
const isCNScore = gateway.isCN ? 0 : 1; // 1 bit
score |= isCNScore << 8;
const ipv4NatScore = ({ // 2 bits
"ports": 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment