fix import, fix ws transport
This commit is contained in:
+2
-1
@@ -1375,7 +1375,7 @@ class Bot
|
||||
|
||||
$t = file_get_contents('/config/nginx_default.conf');
|
||||
if (!empty($json['pac']['domain'])) {
|
||||
$t = preg_replace('/server_name ([^\n]+)?/', "server_name {$json['pac']['domain']};", $t);
|
||||
$t = preg_replace('/server_name ([^\n]+)?/', "server_name *.{$json['pac']['domain']} {$json['pac']['domain']};", $t);
|
||||
preg_match_all('~#-domain.+?#-domain~s', $t, $m);
|
||||
foreach ($m[0] as $k => $v) {
|
||||
$t = preg_replace('~#-domain.+?#-domain~s', $this->uncomment($v, 'domain'), $t, 1);
|
||||
@@ -5505,6 +5505,7 @@ DNS-over-HTTPS with IP:
|
||||
$x = $this->getXray();
|
||||
$p['transport'] = $ws ? 'Websocket' : 'Reality';
|
||||
if (!empty($ws)) {
|
||||
$this->setUpstreamDomain('');
|
||||
$p['reality']['domain'] = $x['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0];
|
||||
$p['reality']['destination'] = $x['inbounds'][0]['streamSettings']['realitySettings']['dest'];
|
||||
$p['reality']['shortId'] = $x['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0];
|
||||
|
||||
Reference in New Issue
Block a user