AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   HTTP Server Lib :) (https://forums.alliedmods.net/showthread.php?t=63512)

hackziner 11-23-2007 11:19

HTTP Server Lib :)
 
10 Attachment(s)
HTTP Server lib ...


This plugin allows to do a small HTTP server that manage ONLY text pages.
the default port of the server is 8081.

Principle: When you try to open a page (for example you try to open http://192.168.0.69:8081/players.html), the plugin accept the connection, call a forward. Each plugin with the forwarded function check if the request is for it, If yes the plugin set the content of the page.

There are two sample:

The first one just display a page when you try to open a file called about.txt

The second one is a page with AJAX, that display and refresh the ingame chat.


http://82.232.102.55/public/images/divers/sample1.JPGthks Alka :)



Required module: Sockets_hz


Greenberet 11-23-2007 11:27

Re: HTTP ..... ... :) (aka another useless plugin)
 
nice but, there are 2 things i dont really like^^
1) put in http_sys.inc the http_page forward
2) Dont create & destroy the forward everytime. just do it in plugin_init/end

regards
green

hackziner 11-23-2007 11:44

Re: HTTP ..... ... :) (aka another useless plugin)
 
Thank you :)

Corrected ^^

Greenberet 11-23-2007 12:12

Re: HTTP ..... ... :) (aka another useless plugin)
 
and now change
Code:
//public http_page(requestedfile[128])
to
Code:
forward http_page(requestedfile[128])
thats what i meanth b4

hackziner 11-23-2007 12:28

Re: HTTP ..... ... :) (aka another useless plugin)
 
^^

corrected ...

Is there a difference if the forward is declared in the include or not ?

Alka 11-23-2007 13:01

Re: HTTP ..... ... :) (aka another useless plugin)
 
Huh, so woot! :D, gj

Quote:

Originally Posted by hackziner
another useless plugin

:|

Greenberet 11-23-2007 13:04

Re: HTTP ..... ... :) (aka another useless plugin)
 
yes
forward is syntax highlighted in the ide^^
and you can easier find them if you search for it.
also if an ide searches for a list of all forwards it would parse functions that have the forward keyword and it would ignore the commented ones.

hackziner 11-27-2007 04:46

Re: HTTP Server Lib :)
 
unfortunately nano does'nt highlight anything :)

CAMEL 12-03-2007 23:38

Re: HTTP Server Lib :)
 
Great ! =) I were waiting for these too long, I think that the futures versions are going to be more short in files... Great work..

Ps. Put a how to install =)..

hackziner 04-24-2008 19:18

Re: HTTP Server Lib :)
 
It's a library ... You're supposed to write the plugin which generate the html page ...I've done two sample, the first with only the sentence about Osaka and the second one which is a page using ajax to display in real time the ingame chat in a page.


All times are GMT -4. The time now is 03:01.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.