Irc (internet relay chat) tutorial

IRC Basics

The people on #distributed normally include DCTI staff and experienced users of the client from around the world, so it’s more than likely that someone will be able to help if you have a question concerning any aspect of distributed.net. A number of the DCTI staff are Channel Operators (Ops). Ops can be identified by a @ before their nick in /names listings and generally highlighted in some way in the user lists in GUI IRC clients. Channel Operators monitor the channel, and will kick (remove) anyone whose behaviour is not acceptable. When you join the channel, until you get used to using IRC, it is a good idea just to watch for a few minutes and see what’s going on, also known as «lurk».

Example

Also see example.js.

var net = require("net");

var Client = require("irc-client");

var Greeter = function Greeter() {
  Client.apply(this, arguments);

  this.regexes_private = ;
  this.regexes_public = ;

  this.on("message:public", function(from, to, message) {
    this.regexes_public.filter(function(regex) {
      var matches;
      if (matches = regex.exec(message)) {
        regex1(from, to, message, matches);
      }
    }.bind(this));
  }.bind(this));

  this.on("message:private", function(from, to, message) {
    this.regexes_private.filter(function(regex) {
      var matches;
      if (matches = regex.exec(message)) {
        regex1(from, to, message, matches);
      }
    }.bind(this));
  }.bind(this));

  this.transfers = ;
};
Greeter.prototype = Object.create(Client.prototype, {properties: {constructor: Greeter}});

Greeter.prototype.match_private = function match_private(regex, cb) {
  this.regexes_private.push(regex, cb);
};

Greeter.prototype.match_public = function match_public(regex, cb) {
  this.regexes_public.push(regex, cb);
};

Greeter.prototype.match = function match(regex, cb) {
  this.match_private(regex, cb);
  this.match_public(regex, cb);
};

var greeter = new Greeter({
  server: {host: "127.0.0.1", port: 6667},
  channels: "#channel",
});

greeter.on("irc", function(message) {
  console.log(message);
});

greeter.match(/^(hey|hi|hello)/i, function(from, to, message, matches) {
  var target = to;

  if (target.toLowerCase() === greeter.nickname.toLowerCase()) {
    target = from;
  }

  greeter.say(target, "no, " + matches1 + " to YOU, " + from.nick);
});

Почему KVIrc?

  • Поддерживает графические смайлики, аватары. Ни один другой открытый IRC клиент на данный момент похвастаться этим не может.
  • Может передавать другим пользователям информацию о поле владельца. Вы легко увидите девушек на своем IRC канале.
  • Полностью бесплатен. Значит, вы можете использовать его где угодно, в том числе на работе. Вы также можете его распространять по локальной сети, устанавливать другим пользователям, изменять программу по своему усмотрению и, при этом, не будете нарушать закон.
  • Существует под все известные операционные системы, такие как Windows, *nix, Mac OS X. Вы можете пользоваться одной программой для IRC, например, под Linux и Windows.
  • Поддерживается, находится в постоянной разработке. Также этот сайт предоставляет поддержку пользователям на русском языке напрямую от разработчиков программы.
  • Очень развитый, удобный язык скриптинга.
  • Полностью конфигурируемый интерфейс. Вы можете изменить любую часть интерфейса, не изменяя кода программы.

API

constructor

Constructs a new client object with the supplied options.

new Client(options);
// basic instantiation
var client = new Client({
  server: {
    host: "127.0.0.1",
    port: 6667,
  },
  nickname: "example",
  username: "irc-client",
  realname: "example client",
  channels: 
    "#channel",
    "#example", "password-for-example",
  ,
});

Arguments

options — an object containing parameters used to instantiate the client.

Options

  • server — an object with and optionally parameters. The default
    is .
  • nickname — a string containing the nickname for the client.
  • username — a string containing the username for the client.
  • realname — a string containing the «real name» for the client.
  • channels — an array containing channels to join upon connection to the
    server. If an entry is a string, it will be joined with no password, but if it
    is an array, it will be treated as and joined as such.

join

Joins a channel, optionally calling a callback with a possible error value when
complete.

client.join(channel, password, cb);
client.join("#example", "example-password", function(err) {
  if (err) {
    console.log("couldn't join #example: " + err);
  } else {
    console.log("joined #example");
  }
});

Arguments

  • channel — a channel name. Easy.
  • password — the password for the channel. Optional.
  • cb — a callback that will be called, possibly with an error, when either the
    channel is joined, or an error happens. If there is no error, the first
    argument will be null. Also optional.

part

Leaves a channel.

client.part(channel, reason);
client.part("#example", "going to sleep");

Arguments

  • channel — the name of a channel that you should be currently in. The effects
    are undefined if you’re not already in that channel.
  • reason — the «reason» for parting the channel. Don’t look back in anger.

say

Sends a message (using PRIVMSG) to a particular target.

client.say(to, text);
client.say("#channel", "good news, everyone");

// OR

client.say("friend", "hi, friend");

Arguments

  • to — the target of the message. Can be anything that a PRIVMSG will work
    against. This is kind of defined by the server.
  • text — the content of the message. Can’t contain newlines or anything else
    that the server doesn’t approve of.

ctcp

Sends a CTCP-style message to a particular target. Mostly a convenience wrapper
around .

client.ctcp(to, text);
client.ctcp("friend", "TIME");

Arguments

(see above)

notice

Sends a NOTICE message to a particular target.

client.notice(to, text);
client.notice("friend", "i'm disconnecting");

Arguments

(see above);

Ссылки[править]

  • dreamterra.net/IRCdocs — Актуальные авторские статьи по установке и настройке IRC-софта
  • kvirc.ru — помощь по IRC и клиенту KVIrc
  • irchelp.org(англ.) — документация по IRC
  • irc-junkie.org(англ.) — новости зарубежного IRC
  • Статистическая информация по различным IRC-сетям(англ.)

Основные протоколы TCP/IP

Прикладной уровень: HTTP, DHCP, IRC, SNMP, DNS, NNTP, XMPP, SIP, BitTorrent, XDR, IPP…

Электронная почта: SMTP, POP3, IMAP4 • Передача файлов: FTP, TFTP, SFTP • Удалённый доступ: rlogin, Telnet, SSH

Транспортный уровень: TCP, UDP, SCTP, DCCP, RTP, RUDP…

Сетевой уровень: IPv4, IPv6, ARP, RARP, ICMP, IGMP

Канальный уровень: Ethernet, 802.11 WiFi, Token ring, FDDI, PPP, HDLC, SLIP, ATM, DTM, X.25, Frame Relay, SMDS, SDH, PDH, ISDN

Физический уровень: RS-232, , , EIA-485…

eo:Interreta relajsa babilo
hu:Internet Relay Chat
ia:Internet Relay Chat
lt:IRC
lv:IRC
nn:Internet Relay Chat
sw:IRC

Instructions for channel ops[edit]

See also w:en:Wikipedia:IRC/Channel access and configuration guide

Freenode channel guidelines suggest that you should hide your operator privileges when you are not using them. As such, the channel services interface Chanserv can be used to grant yourself operator privileges for a brief period of time. You should relinquish these privileges when you are done with them.

Some commands use a hostmask to identify a user. This consists of three portions: . The ‘nick’ refers to the user’s current nickname (which can be changed by the /nick command), the ‘username’ refers to the user’s currently set IRC username (a parameter which the user gives the IRC server when the user connects), and the ‘address’ portion is the person’s IP address, hostname, or cloak, as determined by the IRC server. Any one of these sections may use an asterisk (*) as a «wild card» character: for example, matches any nickname ‘jwales’ at any host, while matches any user with a wikipedia IRC cloak.

In general, bans should be set by hostname unless you have a reason to do otherwise. It is trivial to change nicknames while remaining online. Changing a username is more tedious, but to change a hostname the user typically needs to connect from another machine or IP address (users who do this generally are on a dial-up connection, which must be reset, or abusing some sort of proxy). If it is really necessary, you may wish to use a wildcard in the domain name as well.

New channel setupedit

If you create a new public channel, please consult one of the group contacts first then you should do these commands as the channel op:

To formally register the channel, and set yourself as Founder.
To invite the freenode bot (ChanServ), who will preserve channel settings if everyone else leaves.
To utilize the ‘global bans list’. Please also notify an op in #wikimedia-bans of the channel’s creation.
These two will enable access to the group contacts and freenode staff, in case of problems whilst you’re asleep/away.
Lastly, add the new channel to the listing at IRC/Channels

If a channel is having problems, and you are not an op there, do this to get a list of people to contact:

ChanServ commandsedit

To use these commands, you need to be identified to nickserv, and be granted access to the channel. See . Additionally, in some IRC clients you can use or instead of for these commands.

To give yourself operator status
To remove operator status from yourself
To give someone else operator status
To remove operator status from someone else
To set a user to be automatically removed

Channel operator commandsedit

Various IRC clients have different commands. Most of the commands in this list should work on all popular IRC clients, but there may be additional commands available or alternate syntax for these commands. If there are multiple commands listed and one command fails to work, try using another to accomplish the same result. Consult your IRC client’s manuals, help files, or a general IRC reference for more information about these commands and other command interfaces.

To kick a user (either)
To ban a user
To quickly kick and ban a user
To silence a user
To lock the topic
To switch to «moderated» channel mode
To voice a user in moderated channel mode
To remove operator privileges
To verify that a user is registered, and determine their account name
To permanently invite a user to a private channel (channel mode +i, invite-only)
To revoke a permanent invitation in a private channel
To add someone to a channel’s access list (helps with management of permissions especially in large channels)
To revoke a user’s access to a channel
To rename & redirect a channel to a new name

All channel modes will remain set until removed, with the exception of voice status and operator privileges, which will also be removed if the user in question leaves the channel. Modes can be un-set by using a — instead of a +, or by using an IRC client command such as .

Что такое irc

IRC — Internet Relay Chat — это протокол, позволяющий пользователям общаться друг с другом в реальном времени посредством набора слов на клавиатуре (chat). IRC была написана в 1988 году как улучшение unix программы talk и развился в отдельный протокол. С IRC сейчас работают тысячи пользователей Интернет по всему миру. IRC может служить как и для развлечения, так и для вполне серьезных дел: помощи и консультации в работе, передачи информации и т.п. IRC ипользовался в во время октябрьского путча 93 года, некоторые российские писатели-фантасты периодически устраивают пресс-конференции на определенных каналах. IRC состоит из серверов. Сервер может быть соединен с другими серверами. Совокуность серверов, соединенных друг с другом образует сеть. В мире существуют десятки сетей. Наиболее старые и известные — это IRCNet и EfNet, образовавшейся из расколовшейся первой irc сети. Для работы с irc неободима специальная программа клиент. Для unix самая распространенная — ircII (консольная) со всевозможными front-end для работы под X-Window. Под win32 это mirc. Она проста в настройке и установе настолько, что 90% пользуются именно ею и часто незнающие люди называют irc мирком. Далее надо подключится к серверу. Для этого наберите /server chat.ufa.ru. Более подробно про команды irc клиентов можно прочитать здесь. После подлкючения к серверу можно найти нужного человека и общаться с ним. Можно также подключиться к каналу. Общение на канале напоминает общение людей в комнате. Кто-нибудь говорит и все его слышат. У каждого канала есть имя, которое отражает общую тематику разговора. Это может быть как интересуящая всех тема (например, #linux, #quake), так и просто какое-нибудь объединяющее всех название (например, #ufa, #odessa). Если в первом случае разговоры обычо ведутся вокруг указанной тематики, то во втором случае разговоры ведутся на совершенно разнообразнейшие темы. Кроме обычных пользователей сети irc есть так называемые операторы каналов и операторы сети. Операторы канала — это «хозяины», «короли» канала. Они могут закрыть доступ на канал без приглашения, лишить любого пользователя возможность говорить на канале, выкинуть пользователя с канала, поставить ему бан (невозможность зайти на канал) и многое другое. Иными словами, это управляющие, которые следят за порядком на канале. Оператором канала в классическом случае становится тот, кто первым заходит на канал и тем самым создает его. Но на данный момент такие случаи очень редки. В основном сейчас существует множество постоянных каналов. У таких каналов есть постоянные операторы. Для того, чтобы они получили статус оператора при входе на канал используются обычно постоянно сидящие на канале боты (ии роботы), которые имеют статус оператора и могут его раздавать определенным пользователям. Боты — это программы, которые подключаются к irc серверу и могут выполнять специальные операции. Кроме поддержки статуса оператора, боты могут выполнять функции доски объявлений, могут выводить информацию о заходящем на канал пользователе и множество другого. Отношение к ботам в разных сетях разное и в основном зависит от общей политики сети. Например в IRCNet боты не приветствуются, но и нет регистрации каналов. В сети EfNet регистрации каналов также нет, но к ботам относятся равнодушно. В нашей сети есть регистрация каналов и пока нет серверной программы, автоматически присваивающей хозяинам канала статус оператора канала, для этой цели разрешено использовать ботов, если они не мешают нормальной работе сети. Впрочем, подключение бота без особой на то необходимости тоже не приветствуется. Операторы сети — это администраторы, управляющие работой сети в целом. В их власти выкинуть пользователя с сервера и запретить ему вход на отдельный сервер или вообще на все сервера сети. Однако операторам запрещено вмешиваться во внутренние дела каналов — для этого существуют операторы каналов. Фактически операторы могут вмешиваться только если в результате действий какого-либо пользователя нарушается нормальная работа сети. В нашей сети оператор сети также может вмешиваться в результате захвата канала. Что такое захват канала можно прочитать здесь.

[IRCD: IRC-серверы]

Что такое IRCd

IRCd (расшифровывается как IRC daemon) — это, собственно, сам IRC-сервер, позволяющий использовать возможности IRC-чата. Со времени своего написания, оригинальный код первого IRCd претерпел множество изменений, развились десятки побочных IRC-проектов (ircd-hybrid, Unreal, Nefarious, UltimateIRCd и т. д.). Данная глава призвана упомянуть и описать наиболее популярные из них, а так же, общие советы и рекомендации по установке IRCd.

Популярные IRCd

IRCd-Hybrid (-RU)

Bahamut(ircd-RU)

Примечание: в скобочках указана русская подержка IRCd, например, сеть ByNets оказывает русскую поддержку UnrealIRCd, WeNet — поддержку ircd-RU, базирующемся на Bahamut и т. д.

Установка UnrealIRCd+Anope на Windows

Заходим в корневую папку сервера (там где лежит UnrealIRCd.exe), переходим в папку conf/examples и копируем оттуда файл example в корневую папку сервера.

Скопировали. Переименовываем его в unrealircd ! Это и будет наш конфигурационный файл сервера (далее конфиг).

Открываем любым текстовым редактором, чтобы директивы шли в столбик, а не в строчку! (так удобнее). У меня, например, в роли текстового редактора выступал обычный блокнот.

Доходим до директивы me

В поле name вписываем my.irc.loc
В поле инфо — всё, что угодно. В поле sid — цифру 001.

Идём дальше

Находим директиву oper
Вместо bobsmith напишите свой ник (ник будущего ИРК оператора)
password — пароль будущего ИРК оператора.

Теперь к секции listen.
Убираем (стираем) это:
listen {
ip *;
port 6667;
};
Меняем звёздочку и 6667 на IP адрес и порт вашего ИРК

Находим директиву set
Присваиваем значения опциям:

set {
	network-name 		"my.IRC";
	default-server 		"my.irc.loc";
	services-server 	"services.irc.loc";
	stats-server 		"stats.irc.loc";
	help-channel 		"#main";
	hiddenhost-prefix	"loc";
};

Теперь вернёмся ближе к началу конфига и найдём секцию опций link. Стираем то что там и вставляем:

link            services.irc.loc
{
	username	*;
	hostname 	127.0.0.1;
	bind-ip 	*;
	port 		1234;
	hub             *;
	password-connect "passlink";
	password-receive "passlink";
	class           servers;
		options {
			autoconnect;
		};
};

Ну и дело за малым

Всё! Сервер готов к работе! Можете запустить его (UnrealIRCd.exe) и коннектиться (/server localhost:6667), но друзей звать рановато! Впереди процедура установки сервисов!
Если UnrealIRCd не запустился, можно посмотреть логи в файле service

ServerName - имя IRC сети

В строках UserKey1, UserKey2 и UserKey3 для каждого прописываем семизначные числа. Эти числа не должны начинаться с нуля.
Изменение «TestIRC» в строке NSEnforcerUser к имени вашей сети.
В строке ServicesRoot добавьте свой ник. Это позволит вам добавлять и удалять других администраторов сервисов.

Всё! Сохраняем изменения! И запускаем bin/anope.exe! Ваша IRC сеть готова! Зовите друзей!

Advanced Usage: Services

The freenode.net IRC network runs a comprehensive suite of services bots which are responsible for maintaining the sanity and integrity of the users and channels on the IRC network. Regular users of the network are encouraged to utilize these bots to make their IRC experience more useful.

NickServ allows you to register your nick with the network and protect it with a password to prevent people other than you from using your nick when you are not connected to IRC. Registering your nick is also the foundation required in order to use most of the other services on the network.

Once you’ve connected using the nick you wish to register, simply send a message to NickServ in the form of:

  /msg NickServ register <password> <email address>

After having registered your nick, you’ll want to automate the registration process in your IRC client. Many clients support authenticating with Nickserv, while some require a script to perform the action.

As with all the bots, you can /msg NickServ help for detailed help.

ChanServ allows you to register channels on the network and control who can join them and set other permanent attributes for it. Most users will not need to use ChanServ services.

MemoServ allows you to leave messages for other registered nicks, even if that person is not currently online. Other users can use MemoServ to send messages to you, as well. Sample usage:

  /msg MemoServ send Nugget Cows are cool!
  /msg MemoServ list

Decoding Input

For example:

from jaraco.stream import buffer

irc.client.ServerConnection.buffer_class = buffer.LenientDecodingLineBuffer

The LenientDecodingLineBuffer attempts UTF-8 but falls back to latin-1, which
will avoid UnicodeDecodeError in all cases (but may produce unexpected
behavior if an IRC user is using another encoding).

The buffer may be overridden on a per-instance basis (as long as it’s
overridden before the connection is established):

server = irc.client.Reactor().server()
server.buffer_class = buffer.LenientDecodingLineBuffer
server.connect()

Alternatively, some clients may still want to decode the input using a
different encoding. To decode all input as latin-1 (which decodes any input),
use the following:

irc.client.ServerConnection.buffer_class.encoding = "latin-1"

Or decode to UTF-8, but use a replacement character for unrecognized byte
sequences:

irc.client.ServerConnection.buffer_class.errors = "replace"

Or, to simply ignore all input that cannot be decoded:

class IgnoreErrorsBuffer(buffer.DecodingLineBuffer):
    def handle_exception(self):
        pass


irc.client.ServerConnection.buffer_class = IgnoreErrorsBuffer

Introduction

IRC (Internet Relay Chat) is a way of communicating in real time with people all over the world. IRC is similar to instant-messaging tools except that it is focused on group conversations instead of person-to-person messaging. distributed.net owes its existence to IRC, and IRC is likely to always be the most effective way of getting help using dnetc if the FAQ doesn’t have the answer to your question.

The channel #distributed normally has quite a few people in it and ranges in activity from hectic to very quiet. You will be able to chat with whoever is in the channel at the time. Although it’s the official distributed.net channel, the discussion can frequently stray to other topics.

There are some rules designed to limit inappropriate behaviour on our IRC channel which can be found in our policies document.

Popular IRC Client Software

In order to use IRC (Internet Relay Chat), you will first need to download an IRC Client if you have not already done so. Popular IRC clients for major platforms are:

Windows:
MacOS
Unix X GUI:
Unix Console:
Web browser based:

In addition to the above suggestions, there are many other options available.

Once you have downloaded a client, you will need to configure the software. Use the documentation provided with the software to do this.

The two main settings that need to be configured are a nick name you are going to be identified by and selection of one or more IRC servers you will use to connect to the IRC network.

Уникальные возможности IRC клиента KVIrc

KVIrc имеет уникальную методику передачи дополнительной информации между пользователями программы в IRC. Так, например, на схеме показано отображение пола собеседника и определение ботов.

В таком виде увидеть парней и девушек на IRC канале легко и удобно, если они тоже используют KVIrc. То есть, чем больше людей на вашем канале использует KVIrc, тем точней будет определение пола, и тем удобней будет вам.

Владельцам же IRC ботов eggdrop рекомендуется дописать в конец файла конфигурации eggdrop.conf строчку , и пользователи легко и просто увидят, что у вас на канале есть умный и, безусловно, полезный бот.

А ники отошедших в данный момент от чата людей (в том числе и правильно настроенных BNC) отображаются более светлым цветом. Вы легко поймете, какая часть людей реально присутствует в IRC. Для правильной настройки psyBNC выполните на ней команду .

Advanced Usage: irc-ssl

Although many channels, such as #distributed are public and don’t require encryption to protect the discussions that take place within them, being able to secure your connection to the IRC network is valuable for protecting the privacy of private messages to other users or services bots as well as protecting the communications in any non-public channels you may join. All freenode.net IRC servers support secure SSL connections on ports 6697, 7000, and 7070 to enable this.

For Unix, the procedure depends on whether you have the current or an older version of stunnel. For the current version (5.x) you will need to create a configuration file called stunnel.conf in your home directory with the following:

 client = yes
 verify = 0
 delay = yes
 
 accept = 6667
 connect = chat.freenode.net:7000
 TIMEOUTclose = 0

Then run the following commands in your home directory, after substituting the name of your irc client and your nick:

  $ stunnel stunnel.conf
  $ ircii MyNick www.distributed.net

For older versions of stunnel (3.x or earlier), you’ll want to do something along the lines of the following, after substituting the name of your irc client and your nick:

  $ stunnel -c -d www.distributed.net:6667 -r chat.freenode.net:7000 &
  $ ircii MyNick www.distributed.net

This runs stunnel as a daemon, encrypting your local port 6667 to the freenode.net IRC network. Then you’re simply running your normal IRC client and connecting to «www.distributed.net» instead of the remote server.

Windows usage is very similar:

  1. Create a file stunnel.conf in the same location as the stunnel executable with the same content as the Unix description above.
  2. Start | Run the following command (changing the path to where you installed the executable if not «Program Files» directory)C:\Program Files\irc-stunnel\stunnelw.exeYou should see a little white SSL box appear in your system tray.
  3. You may wish to consider adding that command to your Startup folder.
  4. Run your IRC client and configure it to connect to «www.distributed.net» instead of a remote server. In mIRC, this is simply a matter of typing «/server localhost» in your mIRC window.
Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector