WiiBServer

From GameBrew
Revision as of 06:31, 20 January 2023 by HydeWing (talk | contribs) (HydeWing moved page Wiibserver Wii to WiiBServer)
WiiBServer
File:Wiibserverwii.jpg
General
AuthorJay
TypeUtilities
Version0.1
LicenseMixed
Last Updated2008/06/13
Links
Download
Source

WiiBServer is an unfinished HTTP/1.0 server that serves as a tool for testing networking functions on the Wii. It retrieves resources from the front SD card and is intended for testing and development purposes only.

Features

This server is rather limited (on purpose).

  • process request one after the other (one thread)
  • URIs are limited to 1024 chars
  • resources are loaded from the front sd card, in the /wiibsrv/htdocs folder

History

I just wanted to play a little with networking functions on the wii so I started with something simple, the HTTP/1.0 protocol. Then I decided to try the sd card api and ended up with threads. Very interesting :-)

However, I won't work much on this project because:

  • there's already another project of that kind
  • the HTTP/1.1 protocol is far more complex to handle
  • there's no real point in running a web server on the wii :-S
  • there's already some specialized software for that (apache, ...), would be more interesting to port existing robust software
  • I don't have enough time

Requirements

Nothing special on the wii. On the PC side, a web browser. Some files on sd card in the /wiibsrv/htdocs folder.

How does it work

WiiBServer is a simple application that utilizes socket programming to function as a HTTP/1.0 server for testing networking on the Wii. When launched, the server initializes the socket subsystem, sets up the necessary parameters, and waits for incoming connections.

The IP of the Wii is displayed on screen for clients to connect. The server runs on two threads, one for handling button inputs and the other for accepting connections and processing them. However, the server may experience freezing or dropping connections after a few requests, especially when loading multiple resources for a single html page or when requesting large images. The developer is unable to fix these issues at this time.

Missing/TODOs

  • memory leaks fixing (if any)
  • multithread (possibly with pooling), the process_request() function should be ready for that
  • error templates stored on sd card, in the /wiibsrv/templates folder
  • directory listing
  • http headers handling
  • http/1.1

Run

Launched successfully with the Twilight Hack Wii and the Wii Homebrew Launcher Wii. Didn't try the HBC or TcpLoader but should work.

Once started, you should press the 'A' button to start the accepting thread. Then press 'B' to stop listening. Browse from a web client (use an URL that refers to a file since directory listing is not yet supported).

External links

Advertising: