The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mojo::IRC::Server::Chinese - A Chinese IRC server base on Mojolicious

SYNOPSIS

    use Mojo::IRC::Server::Chinese;
    my $server = Mojo::IRC::Server::Chinese->new(
        host        =>  "0.0.0.0",
        port        =>  6667,
        log_level   =>  "debug",
    );
    $server->run();

    #监听多个地址端口,使用listen参数
    my $server = Mojo::IRC::Server::Chinese->new(
        log_level   =>  "debug",
        listen      => [
            {host=>"0.0.0.0",port=>6667},
            {host=>"0.0.0.0",port=>6668},
        ],
    );
    $server->run();

    #登录验证支持
    my $server = Mojo::IRC::Server::Chinese->new(
        log_level   =>  "debug",
        listen      => [
            {host=>"0.0.0.0",port=>6667},
            {host=>"0.0.0.0",port=>6668},
        ],
        auth        => sub{
            my($nick,$user,$pass) = @_; #传递给验证函数的三个参数依次是 irc客户端的NICK/USER/PASS
            if($nick eq '小灰'){#对于昵称"小灰"进行密码验证
                return 0 if not defined $pass; #没有设置密码,验证失败
                return 0 if $pass ne '123456'; #设置的密码不是 "123456" 验证失败
                return 1; #验证成功,允许正常登录
            }
            else{return 1;}#对其他登录昵称不进行验证,全部允许登录
        },
    );
    $server->run();
    

DESCRIPTION

Mojo::IRC::Server::Chinese是一个基于Mojolicious框架的IRC服务器,采用异步事件驱动,纯中文支持(请使用UTF8编码)

支持使用中文昵称、中文频道名称,不限制昵称长度,让该死的只能使用英文字符见鬼去吧,目前只实现了聊天相关的常用功能

SEE ALSO

https://github.com/sjdy521/Mojo-IRC-Server-Chinese

https://github.com/sjdy521/Mojo-Webqq

https://github.com/sjdy521/Mojo-Weixin

AUTHOR

sjdy521, <sjdy521@163.com>

COPYRIGHT AND LICENSE

Copyright (C) 2014 by sjdy521

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.