v2ray-api-php icon indicating copy to clipboard operation
v2ray-api-php copied to clipboard

Setting Panel to 1 (3xui) Throws "Undefined array key 1"

Open timbogdanov opened this issue 1 year ago • 3 comments

I set the panel to 1 and connect, i get a:

Undefined array key 1
public function __construct()
{
    $serverAddress = 'api://xxxxxx.com/'; # Server Address:Port
    $tunnelServerAddress = null; # Tunnel Server Address:Port
    $username = 'xxxxxx';
    $password = 'xxxxxx';
    $panel = 1; # Panel Type x-ui (0) / 3x-ui (1)

    $this->xui = new xuiConnect($serverAddress, $tunnelServerAddress, $username, $password, $panel);

    $this->xui->setDefaultProtocol('vless');
    $this->xui->setDefaultTransmission('tcp');
}

timbogdanov avatar Nov 01 '24 14:11 timbogdanov

Hi, please provide more details.

mobinjavari avatar Nov 01 '24 19:11 mobinjavari

I was not able to figure what caused this issue. I deleted the files and redownloaded them and this particular issue went away.

timbogdanov avatar Nov 04 '24 08:11 timbogdanov

In most cases, the issue is complicated due to a firewall or certificate or incorrect settings on the server side that prevent the request from being sent. If you are sure that your code is correct, run it in another environment or on another server or host and check that there are no restrictions on sending requests. Also, check that the desired server IP is available on the server or host on which the script is running.

🙏

mobinjavari avatar Nov 08 '24 22:11 mobinjavari