kadet1090 / nucleus Goto Github PK
View Code? Open in Web Editor NEWAsynchronous XMPP Library for PHP based on React
License: MIT License
Asynchronous XMPP Library for PHP based on React
License: MIT License
Trying to install nucleus using composer, install fails because it cannot find fabiang/sasl: dev-rspauth
Looking at the fabiang archive, there does not seem to be a dev-rspauth tag..
(Project looks great and I'm happy to provide any other feedback if I can get installed!)
I am having difficulty with the dnsResolver - so connect still fails.
$client = new Kadet\Xmpp\XmppClient(new \Kadet\Xmpp\Jid('[email protected]'),
[
'loop' => $loop,
'password' => 'password'
]);
On client->connect, this fails with exception at line 50 of TcpXmppConnector.php
Putting echo print_r($this->_resolver); at line 37 - the resolver looks like this:
Kadet\Xmpp\Utils\DnsResolver Object
(
[_results:Kadet\Xmpp\Utils\DnsResolver:private] =>
[_pool:Kadet\Xmpp\Utils\DnsResolver:private] => Array
(
[_xmpp-client._tcp.mydomain.org] => 33554432
[mydomain.org] => 134217728
)
)
So block in lines 38 to 47 is not run - the resolver is not finding the ip and port.
As experiment, I tried setting the jid to use domain google.com (just to see if it would resolve that domain). This resulted in a different error:
ErrorException: Undefined index: target in \vendor\kadet\nucleus\Utils\DnsResolver.php:58
I am on windows and php7.
Any thoughts?
Sorry for such a basic question - my first time with react..
Following code runs straight through, process finished with exit code 0 - rather than awaiting incoming XMPP.. I am obviously missing something! I was assuming this would run as an XMPP client, listening for incoming stanza's and triggering the events.
Thanks for any pointers..
$loop = React\EventLoop\Factory::create();
$client = new Kadet\Xmpp\XmppClient(new \Kadet\Xmpp\Jid('[email protected]/daemon'),
[
'loop' => $loop,
'password' => 'passBoo'
]);
$client->on('stream.open', function (Kadet\Xmpp\Xml\XmlElement $stream) {
echo print_r($stream);
});
$client->on('stream.error', function (Kadet\Xmpp\Stream\Error $error) {
echo print_r($error);
});
$client->on('exception', function (Exception $exception) {
echo print_r($exception);
});
$client->on('element', function (Kadet\Xmpp\Xml\XmlElement $element) {
echo print_r($element);
});
$client->on('connect', function (StreamDuplexInterface $stream) {
echo 'Connected';
});
$client->on('close', function () {
echo 'Closed';
});
$loop->run();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.