Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with connecting via twitch.js #47

Open
coolcalcacol opened this issue Jul 6, 2020 · 8 comments
Open

Issue with connecting via twitch.js #47

coolcalcacol opened this issue Jul 6, 2020 · 8 comments
Assignees
Labels
type: bug Something isn't working

Comments

@coolcalcacol
Copy link

coolcalcacol commented Jul 6, 2020

Describe the bug
Using twitch.js, I get no output from the irc server except a Disconnected unexpectedly error.

To Reproduce
Steps to reproduce the behavior:

const ChatClient = require('twitch-chat-client');
const client = ChatClient.anonymous({
	hostName: 'irc.fdgt.dev',
})
client.connect();

client.onJoin((channel, user) => {
    console.log("Connected");
})

client.onCommunitySub((channel, user, subInfo, msg) => {
    console.log(`${channel}, ${user}, onCommunitySub`);
})

client.onSub((channel, user, subInfo, msg) => {
    console.log(`${channel}, ${user}, onSub`);
})

client.say('#channel', 'submysterygift.tier3 --giftcount 10');
client.say('#channel', 'subscription --tier 3');

Expected behavior
Using the above code, I expect 10 gifted sub events and one tier three regular subscription

@coolcalcacol coolcalcacol added the type: bug Something isn't working label Jul 6, 2020
@thomaslule

This comment has been minimized.

@trezy
Copy link
Collaborator

trezy commented Jul 8, 2020

@thomaslule If you’re using tmi on the server-side, you’ll need to add secure: true to your connection config.

const client = new tmi.Client({
  connection: {
    secure: true,
    server: "irc.fdgt.dev",
  },
});

That’s a failing of the docs that will be addressed by fdgt-apis/website#27.

@thomaslule
Copy link

@trezy oh thanks that's right, sorry for the noise in this issue

@trezy
Copy link
Collaborator

trezy commented Jul 15, 2020

@coolcalcacol I still haven't had a chance to actually verify this bug, but I've got a suspicion that you may need to set the ssl option to true when creating the connection. For example:

const client = ChatClient.anonymous({
  ssl: true,
  hostName: 'irc.fdgt.dev',
})

Let me know whether or not that solves the issue. If so, I'll update the docs.

@d-fischer
Copy link
Contributor

ssl is the default... at least it should be.

@opti21
Copy link

opti21 commented Jul 25, 2020

@d-fischer It is for Twitch, but not for custom servers you have to explicitly mark it secure. I believe it's like that for people running local IRC servers

@d-fischer
Copy link
Contributor

Where'd you get that idea? I know the opposite is true from being the author of the library.

@coolcalcacol
Copy link
Author

Suggested fix didn't work, apologies for the delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants