-
Notifications
You must be signed in to change notification settings - Fork 8
Add irc
transport wrapper.
#22
Add irc
transport wrapper.
#22
Conversation
* | ||
* New BSD License | ||
* | ||
* Copyright © 2007-2015, Hoa community. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2016 Did you start from a fresh master
?
eac4f5e
to
4cf26a3
Compare
@Hywan, the source I've cleaned the PR :
|
Any news on that PR, is that change necessary ? |
); | ||
} | ||
|
||
$port = isset($parsed['port'])?$parsed['port']:6667; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, fix CS with hoa devtools:cs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you read https://tools.ietf.org/html/rfc7194. Maybe we can support irc-u://
(if this is a correct scheme)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've applied code style and read RFC7194.
About irc-u://
what the u
means for you ? Is it for IRCU ports assignment ? I think irc-u
can be considered as a valid scheme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #22 (comment) for more general considerations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is definitively useful. Please, continue!
); | ||
} | ||
|
||
$port = isset($parsed['port'])?$parsed['port']:6667; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you read https://tools.ietf.org/html/rfc7194. Maybe we can support irc-u://
(if this is a correct scheme)?
A specific `Hoa\Irc\Socket` definition has been added which contains the transport factory method. The `Socket` is autoloaded through composer.json. The `Client` and `Node` have been updated to avoid class collision with `Hoa\Socket`.
4cf26a3
to
2c02fe4
Compare
Here is the scheme I have found about IRC:
I guess it's enought information so far :-). |
I think it is 😄 I'll take a look at these two schemes and implement them. Thanks for the docs ! |
Thanks for your work!
|
Hello, I've pushed the I've read the docs and have some questions about the required implementation. Default port
Seems that the standard port today is For me it's not the goal of an Irc library to handle that case but... Question: Is URL Command analysisThe Irc connection URL can contains a lot of details about the connection that must be done : nickname, password, channel... Do we need retrieving detailed URI informations and store them in the connection ? Maybe it's not in this PR that we need to address these questions... Just that for the moment we are throwing away all additional informations given (authentication, channel...). |
About default port, I guess it's safe to assume 6667 is the default one today. Maybe Freenode or EFNet accept port 194 too. You should try. But if they not, then add a comment to explain why we have chosen 6667 over 194 as the RFC stipulates. About the URL command analysis, you are totally right, this is out of the scope of this PR. You should open an issue to not forget to address this point, but this is an interesting feature! |
I've created a new issue to address URI analysis: #25 I've also checked freenode and EFNet connection on port <?php
require_once 'vendor/autoload.php';
$uri = 'tcp://chat.freenode.org:194';
$client = new Hoa\Irc\Client(new Hoa\Socket\Client($uri));
$client->run(); Got that error on freenode :
And this one on EFNet :
So I've added a comment to explain why we choose 6667 as default. |
741b0b5
to
8e9d77e
Compare
} else { | ||
/** | ||
* https://tools.ietf.org/html/draft-butcher-irc-url-04#section-2.4 | ||
* Regarding RFC, port 194 is likely to be a more "authentic" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have written: “Regarding the RFC, the recommended port is 194, however…”.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the comment 👍
I have starting this review 11 days ago, but because of a network issue (probably), it has never been sent… sorry! |
Also allows to define `secure` status of the socket using the wrapper.
8e9d77e
to
64e3a96
Compare
A specific
Hoa\Irc\Socket
definition has been added which contains the transport factory method.The
Socket
is autoloaded through composer.json. TheClient
andNode
have been updated to avoid class collision withHoa\Socket
.The method used here is the same than in
Hoa\Websocket
. I checked that the default port forirc
is 6667 so this is the fallback one.