]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blame - connection.php
Updates for new style of unrealircd-json-rpc:
[irc/unrealircd/unrealircd-webpanel.git] / connection.php
CommitLineData
03ddd26b
BM
1<?php
2
3if (!defined('UNREALIRCD_RPC_USER') ||
4 !defined('UNREALIRCD_RPC_PASSWORD') ||
5 !defined('UNREALIRCD_HOST') ||
6 !defined('UNREALIRCD_PORT')
7) die("Unable to find RPC credentials in your config.php");
8
9$tls_verify = (defined('UNREALIRCD_SSL_VERIFY')) ? UNREALIRCD_SSL_VERIFY : true;
10$api_login = UNREALIRCD_RPC_USER.":".UNREALIRCD_RPC_PASSWORD;
11
12/* Connect now */
13try {
14 $rpc = new UnrealIRCd\Connection("wss://".UNREALIRCD_HOST.":".UNREALIRCD_PORT,
15 $api_login,
16 Array("tls_verify"=>$tls_verify));
17} catch (Exception $e) {
18 die("Unable to connect to UnreaIRCd<br>");
19}