Basic mIRC Based Web Server

By KuTsuM on Mar 13, 2005

Basic mIRC Based Web Server capable of supporting HTML and javascript using a basic socket bot. SocketBot is capable of allowing up to 50 connections at one time. Web Address will be HTTP://Your IP/ [IE: HTTP://] - MUST have knowledge of HTML. Type /mIRCw.HELP for a list of commands - Tested on MSIE(Microsoft Internet Explorer) 5.5 and 6.0

How To Setup:
1st - type /mIRCw.OPEN to open the socket
2nd - get your IP by typing /mIRCw.GetIP
3rd - Set the web page HTML by typing /mIRCw.SetHTML and your HTML/java script here
4th - type /run http://your ip/ to connect to your web server

on :LOAD: { set %mIRCw <HTML><CENTER><FONT COLOR="blue"> My Home Page</FONT><BR>  <FONT COLOR="red">Hosted on mIRCw</FONT></CENTER></HTML> | /mIRCw.HELP }
on *:SOCKREAD:*mIRCw*: {
  sockread -f %temp
  if ($sockerr > 0) { return }
  if ($lines(mIRCwLOG.txt) == $null) { write -c mIRCwLOG.txt }
  write -a mIRCwLOG.txt %temp
on *:SOCKLISTEN:*mIRCw*: {
  set %sockname mIRCw. $+ $rand(1,50)
  sockaccept %sockname
  echo  -a Client connecting(mIRCw): Name: $sock(%sockname).name IP: $sock(%sockname).ip
  if ($sock(%sockname).ip == $read(mIRCwREF.txt,$sock(%sockname).ip)) { sockwrite -n %sockname <HTML><CENTER><FONT COLOR="RED' SIZE="30">Connection Refused: Your IP is listed in CONNECTION REFUSAL PROTOCOL</FONT></CENTER></HTML> | .timer 1 1 sockclose %sockname | echo -a 4Connection Killed:12 $sock(%sockname0.ip) was refused 1[IP Listed in mIRCw Refusal Protocol] | halt }
  sockwrite -n %sockname %mIRCw
  sockclose %sockname
  unset %sockname
alias mIRCw.HELP { echo -a mIRCw Commands: 12/mIRCw.SetHTML 1[Sets HTML] 12/mIRCw.OPEN 4or 12/mIRCw.CLOSE 1[Opens or Closes Server To Public] 12/mIRCw.GetIP 1[Looks up your IP(Your webpage will be http://<your ip>/] 12/mIRCw.REF 1[Opens Refusal TXT(Enter IP: Refuses specific IP from connection to your server)] 2{ Keep In Mind: mIRCw's Socket-based Web Server was tested on Microsoft Internet Explorer version 5.5 & 6.0. mIRCw may not work for any other browsers. Also: Remember you MUST use the <HTML></HTML> tags around your html code.] }
alias mIRCw.GetIP { dns $me | run ipconfig }
alias mIRCw.SetHTML { /set %mIRCw $1- }
alias mIRCw.OPEN { socklisten mIRCw 80 }
alias mIRCw.CLOSE { sockclose mIRCw | sockclose mIRCw.* }
alias mIRCw.REF {
  if ($lines(mIRCwREF.txt) == 0) { write -c mIRCwREF.txt | run mIRCwREF.txt }
  else { run mIRCwREF.txt }


Sign in to comment.
PyThOn   -  Aug 12, 2011

Lmao didnt know about that

jaytea   -  Aug 12, 2011

This makes me sick .......
I try looking for something and i see this script

we don't care. this is not something that needs to be shared with everyone.

I need one to block all mirc connection accept the ones i allow from a host

then why are you posting about it here, on a completely unrelated snippet? you do realize that there is a snippet request forum, don't you?

please stop bumping old posts with your useless comments

PyThOn   -  Aug 11, 2011

This makes me sick .......
I try looking for something and i see this script
I need one to block all mirc connection accept the ones i allow from a host

KuTsuM   -  Nov 20, 2008

haha dude, you must be one angry person. FYI this code again is 2 and a half years old and it was never meant to be an advanced web server. If that was the case I would have made an addon rather than snippet, don't you think? Also, the sockread event is only for the initial connection. After that point it is not needed because mIRC then sends the content of the html page to the client and then the connectin is no longer needed (same would happen if the Connection: close parameters are sent in the initial request). Now I know this has it's bugs and at one point did work, and I haven't updated it at all since I originally posted it because it's meant as basically an example for sockets. I know how to do sockets, just check my tutorial in the tutorials section of the forum, buddy :)

Cypris   -  Oct 30, 2008

Okay.. Now this is a few years old, and mIRC has had a few newer releases since then, but i dont think much has changed that would affect what your script does or how it processes. However, besides the fact it doesnt follow one bit of HTTP Protocol (RFC 2616 roughly). This is a "dumb" webserver at best and thats not meant to be disrespectful or name-calling. DUMB meaning it doesnt know any better...

Remove the idea that this is a "web servers" (or HTTPd) for one second:
-its not processing the SOCKREAD. Why? Because SOCKLISTEN's code contains a sockclose. once you issue this, the socket is dead.

And did anyone notice the ON LOAD isnt written right? if it did, it would set the temp html code and show you the help after you saved it.

Now put back in the idea its a "web server". Doesnt follow protocol, doesnt care what the browser sends it, doesnt send the browser a header, doesnt handle links (add one, unless the page exists on another server, it wont work, it just loads the same code over and over again. So yay, single page website! Im not sure what to call this besides poor, clearly untested coded that was whipped up in a hurry.

Sorry to be such an asshole, but you didnt even script the sockets properly. read up on it. (and the http communication method while your at it)


H_M   -  Aug 17, 2008

Don't rate this script low just because you don't know how to use it :) I like this script quite a lot, useful for having some fun.

DeltaFlyer   -  May 28, 2006

echo -a 4Connection Killed:12 $sock(%sockname0.ip) was refused 1[IP Listed in mIRCw Refusal Protocol]
hey mate :)
i think that in the above line, $sock(%sockname0.ip) should actually be $sock(%sockname).ip

XpLoiTeR   -  Jan 16, 2006

that deserves higher score..atleast 7 or 8

KuTsuM   -  Jan 03, 2006

It\'s a website server that\'s hosted with mIRC

No0ne   -  Dec 26, 2005

So, this sets up a chat for mirc acccess only? Sorry, i\'m confused on what this does.

Lucifer1   -  Mar 23, 2005

Uhhh... can\'t you supply a chat or something???

KuTsuM   -  Mar 17, 2005

Yeah.. sorry i updated after you said that and didnt check the comments

xDaeMoN   -  Mar 17, 2005

I did, and it was not there before when I posted my comment. He must have updated it when he read my post. See the date of the last update.

StonedStoner   -  Mar 17, 2005

read the authors notes....

xDaeMoN   -  Mar 14, 2005

An explanation of usage would have been nice.

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.