latest http protocol?

Started by
8 comments, last by Emmanuel Deloget 18 years, 6 months ago
Hi A friend and me had the idea to write a little browsergame in C++ and we would like to write our own webserver based on the latest http protocol I have been looking on the web but the links there are around 3-4 years old What we need is access to variables posted via urls and a way to send processed data to the client e.g.: the page do you know any up to date description of the protocol?
http://www.8ung.at/basiror/theironcross.html
Advertisement
The current version of HTTP is 1.1, and yes, it is several years old. You can read the protocol's full specification in RFC 2616.
Jooleem. Get addicted.
ok thx
http://www.8ung.at/basiror/theironcross.html
Write a custom webserver? Is anything wrong with current ones? Think that all that time you invest in writing your webserver may be used to enhance your game.

Luck!
Guimo
well i don t want to work with php or any of these scripting languages
http://www.8ung.at/basiror/theironcross.html
Quote:Original post by Basiror
well i don t want to work with php or any of these scripting languages

PHP is a scripting language that can be accessed through existing HTTP servers like Apache. If you're really looking to create your own HTTP server because you don't want to use PHP, I would instead suggest creating a scripting language that could be used through existing servers as PHP or Perl does. However, even these languages have had TONS of help to get them where they are today, so if you really insist on making your own script interpreter for a custom language, I wish you lots of luck, you'll need it.
I'm fairly sure that Apache (not sure about IIS) can run an executable (ie. your compiled C++ program) on a request.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
On the other hand, writing a webserver is no big deal. It can be done in a couple of hours, literally. (Of course, if you want something to match Apache, it gets a bit more complex [wink])

But I still agree, if you want to make a browser game, use PHP or ASP.net or something. It'll be easier, more robust, and probably even run faster (Yes, PHP is slower than native machine code, but it does have the advantage of running on a state-of-the-art webserver, which will probably handle heavy loads much better than anything you write.
do you know some http libraries for c++ to implement a webserver


i dislike the use of php and asp, although we thought about a hybrid approach

using php to pass the html pages to the clients and doing the webserver <-> game server communication via sockets but as far as i know php supports only strings to be send over sockets which requires some parsing in our gameserver

i think we will move with the hybrid approach

http://www.8ung.at/basiror/theironcross.html
Quote:Original post by joanusdmentia
I'm fairly sure that Apache (not sure about IIS) can run an executable (ie. your compiled C++ program) on a request.


Using what is commonly know as the Common Gateway Interface, or CGI for short.

You won't be able to send binary data to a web server and hope it will understand it. The HTTP protocol is purely text-driven, and the best you can do is to send him a text request with a binary attachement (the technique is used to upload files to a server). When you request some information from the server, it sends you a text header (the MIME header you may already know) and then the data. The granularity of these requests is the file level - ie you can't request anything else but files. When the browser receives the server response, it may or may not understand the text header. If it don't understand it then it will probably download the data instead of displaying it.

Thus, if you want to add some custom functions to your HTTP server, you'll also have to write the custom HTTP browser that will understand how to react to this custom functions. I believe that beginning a rewrite of both Apache and Firefox is not the good way of making an online game ;)

What you want to write is not a HTTP server, it is a custom game server.

I suggest you to take the time to think again to your game design, find your real needs, and asks here whether it can be done or not using existing technologies (there is already some great stuff out there).

PHP is rather great. It works well and is fast. I don't know ASP but I was told that ASP languages are clearer than PHP (the PHP syntax is a bit weird sometimes, and PHP code can be painfull to read). Maybe gamedev sites maintainers can give us more information about ASP. What do you dislike in both PHP and ASP (beside the fact that they are not C++, of course)?

HTH,

This topic is closed to new replies.

Advertisement