fix sni
This commit is contained in:
@@ -267,7 +267,7 @@ export class ClientController {
|
||||
} catch (e) {
|
||||
return link;
|
||||
}
|
||||
} else if (link.startsWith('vless://') || link.startsWith('trojan://')) {
|
||||
} else if (link.startsWith('vless://') || link.startsWith('trojan://') || link.startsWith('hy2://')) {
|
||||
return link.replace(/@.*?:/, `@${newHost}:`);
|
||||
} else if (link.startsWith('ss://')) {
|
||||
if (link.includes('@')) {
|
||||
|
||||
@@ -516,6 +516,6 @@ export class InboundBuilderService {
|
||||
params.set('obfs', obfs);
|
||||
params.set('obfs-password', obfsPass);
|
||||
|
||||
return `hy2://${auth}@${serverAddress}:${port}/?${params.toString()}#${this.flag}%20${encodeURIComponent(remark)}`;
|
||||
return `hy2://${auth}@${serverAddress}:${port}/?${params.toString()}#${remark}`;
|
||||
}
|
||||
}
|
||||
@@ -134,11 +134,7 @@ private async rotateSubscription(sub: Subscription, domains: Domain[]) {
|
||||
const type = config.type;
|
||||
const uuid = uuidv4();
|
||||
|
||||
// Определяем SNI
|
||||
let sni = 'unknown';
|
||||
if (type !== 'custom' && type !== 'vmess-tcp' && type !== 'shadowsocks-tcp') {
|
||||
sni = (!config.sni || config.sni === 'random') ? this.pickDomain(domains) : config.sni;
|
||||
}
|
||||
let sni = '';
|
||||
|
||||
// === 1. Обработка Custom ===
|
||||
if (type === 'custom') {
|
||||
@@ -152,11 +148,13 @@ private async rotateSubscription(sub: Subscription, domains: Domain[]) {
|
||||
});
|
||||
await this.inboundRepo.save(newInbound);
|
||||
continue;
|
||||
} else {
|
||||
sni = config.sni === 'random' ? this.pickDomain(domains) : config.sni;
|
||||
}
|
||||
|
||||
// === 2. Обработка Hysteria2 ===
|
||||
if (type === 'hysteria2-udp') {
|
||||
const link = this.inboundBuilder.buildHysteria2Link(serverAddress, sni, 'Hysteria2');
|
||||
const link = this.inboundBuilder.buildHysteria2Link(serverAddress, sni, flagEmoji + '%20hysteria2-udp');
|
||||
const newInbound = this.inboundRepo.create({
|
||||
xuiId: 0,
|
||||
port: 0, // Обычно Hysteria висит на 443, фактический порт вытаскивается в билдере
|
||||
|
||||
Reference in New Issue
Block a user