-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b09ba62
commit 2df77c5
Showing
3 changed files
with
28 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
const Parser = require('..') | ||
const net = require('net') | ||
|
||
const client = net.connect({ | ||
port: 6667, | ||
host: 'irc.freenode.org', | ||
}) | ||
import Parser from '../dist/slate-irc-parser.modern.mjs' | ||
import { connect } from 'node:tls' | ||
|
||
const parser = new Parser() | ||
parser.on('message', console.log) | ||
|
||
client.pipe(parser) | ||
|
||
parser.on('message', (msg) => { | ||
console.log() | ||
console.log(msg) | ||
const client = connect({ | ||
port: 6697, | ||
host: 'irc.libera.chat', | ||
}) | ||
client.pipe(parser) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
const Parser = require('..') | ||
import Parser from '../dist/slate-irc-parser.modern.mjs' | ||
|
||
const parser = new Parser() | ||
const lines = [ | ||
`:molybdenum.libera.chat NOTICE * :*** Checking Ident\r\n`, | ||
`:molybdenum.libera.chat NOTICE * :*** Looking up your hostname...\r\n`, | ||
`:molybdenum.libera.chat NOTICE * :*** No Ident response\r\n`, | ||
`:molybdenum.libera.chat NOTICE * :*** Couldn't look up your hostname\r\n`, | ||
`ERROR :Closing Link: 127.0.0.1 (Connection timed out)\r\n`, | ||
] | ||
|
||
parser.on('message', (msg) => { | ||
console.log() | ||
console.log(msg) | ||
}) | ||
const parser = new Parser() | ||
parser.on('message', console.log) | ||
|
||
parser.write( | ||
':hitchcock.freenode.net NOTICE * :*** Looking up your hostname...\r\n', | ||
) | ||
parser.write(':hitchcock.freenode.net NOTICE * :*** Checking Ident\r\n') | ||
parser.write('ERROR :Closing Link: 127.0.0.1 (Connection timed out)\r\n') | ||
for (const line of lines) { | ||
parser.write(line) | ||
} |