]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - connection.php
985d3fb0af313eae5b15cff1c01fb20c468d54ce
[irc/unrealircd/unrealircd-webpanel.git] / connection.php
1 <?php
2
3 if (!defined('UPATH'))
4 die("Access denied");
5
6 if (!defined('UNREALIRCD_RPC_USER') ||
7 !defined('UNREALIRCD_RPC_PASSWORD') ||
8 !defined('UNREALIRCD_HOST') ||
9 !defined('UNREALIRCD_PORT')
10 ) die("Unable to find RPC credentials in your config.php");
11
12 $tls_verify = (defined('UNREALIRCD_SSL_VERIFY')) ? UNREALIRCD_SSL_VERIFY : true;
13 $api_login = UNREALIRCD_RPC_USER.":".UNREALIRCD_RPC_PASSWORD;
14
15 /* Connect now */
16 try {
17 $rpc = new UnrealIRCd\Connection
18 (
19 "wss://".UNREALIRCD_HOST.":".UNREALIRCD_PORT,
20 $api_login,
21 Array("tls_verify"=>$tls_verify)
22 );
23 } catch (Exception $e) {
24 die("Unable to connect to UnreaIRCd<br>");
25 }