November 14, 2018, 07:48:13 pm

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

0 Members and 1 Guest are viewing this topic.

stormeus

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 1753
  • Country: us
  • VC:MP Developer
    • View Profile
    • GTA VICE CITY Respective owner
    • Awards
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: 2843
  • Country: nl
    • View Profile
    • Awards
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"



VoLK

  • Vice War Staff
  • Crazy Man
  • *
  • *
  • Posts: 1688
  • Country: lt
  • the most interesting man in VCMP v2
    • View Profile
    • Vice Legends
    • Awards
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: 1753
  • Country: us
  • VC:MP Developer
    • View Profile
    • GTA VICE CITY Respective owner
    • Awards
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: 1753
  • Country: us
  • VC:MP Developer
    • View Profile
    • GTA VICE CITY Respective owner
    • Awards
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

  • Vice Underdog Trainee
  • Fanatic
  • *
  • *
  • Posts: 237
  • Country: pk
  • sarcastic AF
    • View Profile
    • Awards
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

Code: [Select]
<sarcasm>[VU_T]Thomas</sarcasm>
Quote
<&RostySpoon> [16] nuts*: your anus is a furnace
Vice War 8 Scripting Advisor
Vice War 8 Web Master
Playing VC-MP Since 2009
Thom. HeisenBerg

stormeus

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 1753
  • Country: us
  • VC:MP Developer
    • View Profile
    • GTA VICE CITY Respective owner
    • Awards
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

  • Vice Underdog Trainee
  • Fanatic
  • *
  • *
  • Posts: 237
  • Country: pk
  • sarcastic AF
    • View Profile
    • Awards
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

Code: [Select]
<sarcasm>[VU_T]Thomas</sarcasm>
Quote
<&RostySpoon> [16] nuts*: your anus is a furnace
Vice War 8 Scripting Advisor
Vice War 8 Web Master
Playing VC-MP Since 2009
Thom. HeisenBerg