custom_config, true); if ((int) $node_raw->sort === 11) { $v2_port = $node_custom_config['offset_port_user'] ?? ($node_custom_config['offset_port_node'] ?? 443); $security = $node_custom_config['security'] ?? 'none'; $network = $node_custom_config['network'] ?? ''; $header = $node_custom_config['header'] ?? ['type' => 'none']; $header_type = $header['type'] ?? ''; $host = $node_custom_config['header']['request']['headers']['Host'][0] ?? $node_custom_config['host'] ?? ''; $path = $node_custom_config['header']['request']['path'][0] ?? $node_custom_config['path'] ?? '/'; $v2rayn_array = [ 'v' => '2', 'ps' => $node_raw->name, 'add' => $node_raw->server, 'port' => $v2_port, 'id' => $user->uuid, 'aid' => 0, 'net' => $network, 'type' => $header_type, 'host' => $host, 'path' => $path, 'tls' => $security, ]; $links .= 'vmess://' . base64_encode(json_encode($v2rayn_array)) . PHP_EOL; } else if ((int) $node_raw->sort === 0) { // case 0: // $node = [ // 'protocol' => 'shadowsocks', // 'settings' => [ // 'address' => $node_raw->server, // 'port' => (int) $user->port, // 'method' => $user->method, // 'password' => $user->passwd, // ], // 'tag' => $node_raw->name, // ]; // // break; $ss_array = [ // 'v' => '2', 'ps' => $node_raw->name, 'add' => $node_raw->server, 'port' => (int) $node_custom_config['offset_port_user'], 'encryption' => $user->method, 'password' => $user->passwd, // 'id' => $user->uuid, // 'aid' => 0, // 'net' => $network, // 'type' => $header_type, // 'host' => $host, // 'path' => $path, // 'tls' => $security, ]; $links .= 'shadowsocks://' . base64_encode(json_encode($ss_array)) . PHP_EOL; } } return $links; } }