login
March 19, 2024, 10:38:48 am

Author Topic: SqHTTP: Socket-Based HTTP Server  (Read 3140 times)

0 Members and 1 Guest are viewing this topic.

stormeus

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 1755
  • Country: us
  • VC:MP Developer
    • View Profile
    • GTA VICE CITY Respective owner
SqHTTP: Socket-Based HTTP Server
« on: May 17, 2012, 02:07:48 am »
Became extremely bored, wrote an HTTP server using Squirrel sockets over the course of two days. The server supports:
  • HTTP requests
  • Error handling (sending 500 Internal Server Errors on a script parsing exception)
  • Query strings (in format of http://server/page/?param1=value1&param2=value2)
  • All functions provided by VC:MP Squirrel
  • Modules loaded by your scripts
  • Writing dynamic pages and static pages from existing files

The purpose of the server is to provide a limited form of providing web services to scripters directly from their game servers, such as a stats panel and remote administration, and is not suitable for forums, transmitting files, and probably some other complex things I couldn't be arsed to script into the server. ::)

I don't anticipate this server script taking off any time in the near future, so I won't be providing much support for it, though it may prove to be useful for any projects I do in the future, and possibly for someone else as well.

Without the example pages provided, the server is 603 lines long.

Download (1.0.0)
http://stormeus.vicelegends.com/SqHTTP.7z
« Last Edit: May 19, 2012, 03:32:00 am by stormeus »
Winner Winner x 2 (list)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

<krystianoo> stormeus do good job
<krystianoo> with recent update
<krystianoo> if not agree; jeb yourself in head
<Avenger> yesterday you said death to stormeus
<karan> double standard krystianoo
<karan> he called him fake prophet too
<krystianoo> sure fake prophet
<krystianoo> but with recent updates real

Shadow

  • Guest
Re: SquirrelHTTP: A Simple HTTP Socket Server
« Reply #1 on: May 17, 2012, 05:56:49 am »
What can I say.. Excellent as everytime.
Cannot rate own posts


Thijn

  • Forum Administrator
  • Crazy Man
  • *
  • *
  • *
  • Posts: 2946
  • Country: nl
    • View Profile
Re: SquirrelHTTP: A Simple HTTP Socket Server
« Reply #2 on: May 17, 2012, 07:38:08 am »
I wanted the first post :'(

Very very very nice work :)
Agree Agree x 1 (list)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

I'm not totally useless,
I can be used as an bad example ;)

"Never do Today, What you can do Tomorrow"


morphine

  • Crazy Man
  • *****
  • Posts: 1907
  • Country: lt
    • View Profile
Re: SquirrelHTTP: A Simple HTTP Socket Server
« Reply #3 on: May 17, 2012, 08:23:55 am »
Interesting.
Agree Agree x 1 (list)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


stormeus

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 1755
  • Country: us
  • VC:MP Developer
    • View Profile
    • GTA VICE CITY Respective owner
Re: SquirrelHTTP: A Simple HTTP Socket Server
« Reply #4 on: May 17, 2012, 10:20:34 am »
Heads up, after copying this script verbatim, fixing function names, and testing it in LU, I found that the server will NOT WORK verbatim in LU.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

<krystianoo> stormeus do good job
<krystianoo> with recent update
<krystianoo> if not agree; jeb yourself in head
<Avenger> yesterday you said death to stormeus
<karan> double standard krystianoo
<karan> he called him fake prophet too
<krystianoo> sure fake prophet
<krystianoo> but with recent updates real

stormeus

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 1755
  • Country: us
  • VC:MP Developer
    • View Profile
    • GTA VICE CITY Respective owner
Re: SquirrelHTTP: A Simple HTTP Socket Server
« Reply #5 on: May 19, 2012, 03:30:13 am »
Updated to 1.0.0, introducing:
  • POST support
  • Forming pages from script files (examples provided in link)
  • Proper query strings (?param1=value1&param2=value2)
  • Small aesthetic/performance modifications
  • Change of name to SqHTTP
« Last Edit: May 19, 2012, 03:32:15 am by stormeus »
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

<krystianoo> stormeus do good job
<krystianoo> with recent update
<krystianoo> if not agree; jeb yourself in head
<Avenger> yesterday you said death to stormeus
<karan> double standard krystianoo
<karan> he called him fake prophet too
<krystianoo> sure fake prophet
<krystianoo> but with recent updates real

Thomas

  • Crazy Man
  • *****
  • Posts: 942
  • Country: pk
  • Death awaits you always
    • View Profile
Re: SquirrelHTTP: A Simple HTTP Socket Server
« Reply #6 on: June 24, 2018, 03:12:26 pm »
Updated to 1.0.0, introducing:
  • POST support
  • Forming pages from script files (examples provided in link)
  • Proper query strings (?param1=value1&param2=value2)
  • Small aesthetic/performance modifications
  • Change of name to SqHTTP
Bump!

Do you still have the live link to this? i am up to something.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Vice War 8 Developer
Vice War 8 Web Master
Playing VC-MP Since 2009
Representing Miami Killers.
T4iVi3R | HeisenBerg | Thomas | Tom4S

stormeus

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 1755
  • Country: us
  • VC:MP Developer
    • View Profile
    • GTA VICE CITY Respective owner
Re: SqHTTP: Socket-Based HTTP Server
« Reply #7 on: June 24, 2018, 11:45:08 pm »
Nah, I think the files I had for this are long gone, sorry.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

<krystianoo> stormeus do good job
<krystianoo> with recent update
<krystianoo> if not agree; jeb yourself in head
<Avenger> yesterday you said death to stormeus
<karan> double standard krystianoo
<karan> he called him fake prophet too
<krystianoo> sure fake prophet
<krystianoo> but with recent updates real

Thomas

  • Crazy Man
  • *****
  • Posts: 942
  • Country: pk
  • Death awaits you always
    • View Profile
Re: SqHTTP: Socket-Based HTTP Server
« Reply #8 on: June 25, 2018, 04:03:26 pm »
Nah, I think the files I had for this are long gone, sorry.

Can you atleast give me the philosophy behind a squirrel socket to use it as a listener, because after all these years i forgot about this crap. ._.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Vice War 8 Developer
Vice War 8 Web Master
Playing VC-MP Since 2009
Representing Miami Killers.
T4iVi3R | HeisenBerg | Thomas | Tom4S