Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

The Http Web Server


  • Please log in to reply
4 replies to this topic

#1 jlgager

jlgager

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 12 April 2012 - 10:57 AM

The HTTP Web Server 1.0.0.3


Posted Image Posted Image

The HTTP Web Server is an easy-to-use, FAST web hosting server that is written in C#.

It has a built-in Install/Uninstall menu and is console based.

Features:

Ability to define the Server Root Path, Document Root Path, Listening Port, Admin Email Address, and the Directory Index Filenames.

Full install menu that installs to one of two locations, either the server running directory or the directory “C:\The HTTP Web Server”.

Uninstall option uninstalls and removes all files in the folders.

Install has two folders, “conf”, and “htdocs”.

The “conf” folder has two files, httpd.conf, which is the main config file, and mime.type, which configures what file types, can be viewed in the browser.

The “htdocs” folder has “index.html”, which is a template web page. This folder is where you will put all the files you are hosting with your site.

You can install to "C:\The HTTP Web Server" by using the switches: "-i", "/i", "-install", "/install"
You can uninstall from both locations by using the switches: "-u", "/u", "-uninstall", "/uninstall"
You can start the server by using the switches: "-start", "/start"
You can stop all running processes of the server by using the switches: "-stop", "/stop"
(Please note that all errors that occur in these modes will automatically close the server after 5 seconds and will not return you to the main menu.)

This web server is in the very early stages of development and is currently very basic. This is where I need your help as a developer to help add features that are not currently available. I ask as you make changes that you please fully comment every change and section of code to promote easier code readability. Thanks!


DownloadYou can check out this project's Codeplex site at http://thehttpwebserver.codeplex.com.
You can download the current source files here.

PLEASE NOTE: This program is licensed under the GNU General Public License version 2 (GPLv2).
Click here to read the license terms.


--
Version 1.0.0.3 changes (4/12/2012):
* Added "Start", "Stop", "Install", and "Uninstall" Command Line Switches

Version 1.0.0.2 changes (4/12/2012):
* Fixed Localhost problem now works with domain names

Version 1.0.0.1 changes (4/11/2012):
* First Release.
--

Here is a list of features that I would like to add:

(I will star off the items as they are added to the code and I will be adding to this list more items as required.)

***FIXED: Use across the network and with domain names. (Currently you can only access with localhost even if the port is forwarded.)***

PHP, MySQL and webdav integration

PHPMyAdmin integration

.htaccess and .htpasswd or web.config integration

Mod Rewrite Integration

GUI Form Interface

***ADDED: Ability to stop and start the server without just closing it***

***ADDED: Command Arguments (i.e. –start, -stop, /start, /stop)***

Lengthened list of mimes

Directory listing on empty folders with change current visible hierarchy folder view

Prevent .htaccess and .htpasswd files from being viewed by Web clients.

Virtual Directories Integration

Error 414 Request-URI size limit

Install server as a service that starts automatically with windows

Make server try to download file if not a recognized mime type

Better Error Pages (404, 500 or others that can be found here.)


Posted Image
Want to thank me?
Then just hit the "Like This" button on this post!
Also post any ideas for future updates.
  • 2

#2 John

John

    CC Mentor

  • Moderator
  • 4450 posts
  • Location:New York, NY

Posted 12 April 2012 - 11:34 AM

Very cool. What kind of model do you use to handle multiple (concurrent) requests? Event-driven? Threaded?
  • 1

#3 jlgager

jlgager

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 12 April 2012 - 12:47 PM

I'm doing Theading using the TcpListener class. But the problem I am having is that I can only access it by localhost. Even with port 80 forwarded I still cannot access it with my domain name or another computer on my network.

IPAddress localhost = IPAddress.Parse("127.0.0.1");
myListener = new TcpListener(localhost, port);
myListener.Start();

UPDATE: I just figured out how to fix it.
myListener = new TcpListener(IPAddress.Any, port);
myListener.Start();
  • 1

#4 fread

fread

    Programming God

  • Senior Member
  • PipPipPipPipPipPip
  • 897 posts
  • Location:Trinidad and Tobago
  • Learning:C, Java, C++, C#, PHP, Python, PL/SQL

Posted 12 April 2012 - 02:48 PM

Very impressive!
  • 1

#5 tavichh

tavichh

    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 399 posts
  • Location:Delaware
  • Programming Language:C#
  • Learning:C++, PHP, JavaScript

Posted 14 April 2012 - 10:38 PM

This is actually quite good! Hoping to see a GUI later though -.-
  • 0
Send a like my way if I helped you or if you found my post useful or even just enjoyed reading my post.
Thank you :)




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download