Using uppercase PASS and NICK commands triggers a connection reset by peer

Hello,

I’m in the process of writing a small bot for Twitch chat, and I am using ncat to connect to twitch chat and explore a bit.

The problem is that every time I use uppercase PASS and NICK commands to connect to the server I get a “Connection Reset by Peer” error after the NICK command is sent.

This does NOT happen when using lowercase pass and nick commands. Here’s the output of ncat:

$ ncat irc.chat.twitch.tv 6667
PASS oauth:youdontneedtoknowmyoauthtoken
NICK kustomgames
Ncat: Connection reset by peer.
$ ncat irc.chat.twitch.tv 6667
pass oauth:youdontneedtoknowmyoauthtoken
nick kustomgames
:tmi.twitch.tv 001 kustomgames :Welcome, GLHF!
:tmi.twitch.tv 002 kustomgames :Your host is tmi.twitch.tv
:tmi.twitch.tv 003 kustomgames :This server is rather new
:tmi.twitch.tv 004 kustomgames :-
:tmi.twitch.tv 375 kustomgames :-
:tmi.twitch.tv 372 kustomgames :You are in a maze of twisty passages, all alike.
:tmi.twitch.tv 376 kustomgames :>

This is highly annoying since any IRC library I might rely on uses uppercase commands.

Is this by design or a bug? Am I the only one having this issue?

Thank you!

I always send uppercase commands:

    this.send("PASS " + oAuth);
    this.send("NICK " + login);

And have not had a problem, that said, I am not aware of Twitch having an issue with uppercase PASS or NICK commands, and not sure why you would have an issue.

Also, just using a straight telnet connection:
[Nyx] /opt/iobot/scripts/games
% telnet irc.chat.twitch.tv 6667
Trying 52.32.237.213…
Connected to irc-production-388322493.us-west-2.elb.amazonaws.com.
Escape character is ‘^]’.
PASS oauth:hiding_oauth_key
NICK illusionarybot
:tmi.twitch.tv 001 illusionarybot :Welcome, GLHF!
:tmi.twitch.tv 002 illusionarybot :Your host is tmi.twitch.tv
:tmi.twitch.tv 003 illusionarybot :This server is rather new
:tmi.twitch.tv 004 illusionarybot :-
:tmi.twitch.tv 375 illusionarybot :-
:tmi.twitch.tv 372 illusionarybot :You are in a maze of twisty passages, all alike.
:tmi.twitch.tv 376 illusionarybot :>

Same issue with any library I can use. Since they send uppercase commands I get an err conn reset

Same goes for a simple telnet connection:

$ telnet irc.chat.twitch.tv 6667
Trying 54.69.84.41...
Connected to irc-production-388322493.us-west-2.elb.amazonaws.com.
Escape character is '^]'.
PASS oauth:aintnobodoygotkeyfodat
NICK kustomgames
Connection closed by foreign host.
$ telnet irc.chat.twitch.tv 6667
Trying 52.32.156.153...
Connected to irc-production-388322493.us-west-2.elb.amazonaws.com.
Escape character is '^]'.
pass oauth:aintnobodoygotkeyfodat
nick kustomgames
:tmi.twitch.tv 001 kustomgames :Welcome, GLHF!
:tmi.twitch.tv 002 kustomgames :Your host is tmi.twitch.tv
:tmi.twitch.tv 003 kustomgames :This server is rather new
:tmi.twitch.tv 004 kustomgames :-
:tmi.twitch.tv 375 kustomgames :-
:tmi.twitch.tv 372 kustomgames :You are in a maze of twisty passages, all alike.
:tmi.twitch.tv 376 kustomgames :>

This is strange to say the least

That is very strange! I honestly have not seen this before.

This is getting stranger by the minute. Using ncat/telnet from one of my servers (instead of my workstation) I can connect using uppercase PASS and NICK commands.

This issue seems to be limited to my workstation. Small dump for future reference:

Ubuntu 16.04, kernel is 4.4.0-47-generic 
The libc used by telnet/ncat: GNU C Library (Ubuntu GLIBC 2.23-0ubuntu4) stable release version 2.23

Sounds like it could be a firewall blocking the IRC protocol.

Doesn’t seem likely since ncat can connect to the server on that precise port and sending lowercase commands work.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.