2009-10-17

Single-file IRC server

Those of you that know what IRC is are probably already thinking I'm off my rocker, given the title of this post. And I probably am. I decided to try my hand at writing an IRC server in a single Java file. I've got it to the point that people can connect to it, join channels, set the channel topic, send messages (and receive them) at channels, send private messages, and change nicks, so I figured I'd blog about it and include a link to it if anyone wants to use it. It's not intended to become a production IRC server; I'm mostly writing it so that I can test out an IRC bot that I'm writing when I don't have an internet connection.

Anyway, here's the source code for the server. Download it, compile it with "javac Connection.java", and then run it with "java Connection <hostname>", replacing <hostname> with your computer's hostname. If you're not sure what your computer's hostname is, just use localhost as the hostname. Then, open your favorite IRC client, connect to "127.0.0.1:6667", and join any channel you want. You can switch nicks, set the channel's topic (even though you're not a channel op), and other users can connect, join channels, and chat with you. Sending messages directly between users also works. Modes do not, however (channels always act as if they are mode +nt, no matter what you set their mode to be, but anyone can change the topic even though the channels have +t present). I'm hoping to add more functionality to this server soon.Link

8 comments:

Dan said...

NEEDS MORE OBJECTS

Unknown said...

can't figure out how to sue it.

Unknown said...

*use

Unknown said...

What port does it use? I ahve it in a jar and it's running, just can't figure what port it's on.

Unknown said...

So, I was looking through the code, and I decided I wanted to make a command. I found a bit where it said Command CommandObject = null; blah blah blah but I couldn't figure out how it processed the different commands and how I could add one.

Unknown said...
This comment has been removed by the author.
for ict 99 said...

I have read your blog its very attractive and impressive. I like it your blog.

Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

Java Online Training Java Online Training Core Java 8 Training in Chennai Core java 8 online training JavaEE Training in Chennai Java EE Training in Chennai

Unknown said...

Merkur 37C Safety Razor Review – Merkur 37C
The Merkur 바카라사이트 37c is an excellent short handled DE safety razor. It herzamanindir.com/ is more novcasino suitable for both heavy and non-slip deccasino hands and is therefore a titanium ring great option for experienced