Skip to content

Instantly share code, notes, and snippets.

@snuxoll
Created June 17, 2009 04:28
Show Gist options
  • Save snuxoll/131080 to your computer and use it in GitHub Desktop.
Save snuxoll/131080 to your computer and use it in GitHub Desktop.
using GLib;
namespace SoupServer {
class ServerApplication : Object {
private Soup.Server server;
public ServerApplication() {
server = new Soup.Server(Soup.SERVER_PORT, 8000, null);
}
public void respond(Soup.Server server, Soup.Message msg,
string path, HashTable? query, Soup.ClientContext client) {
msg.set_status(Soup.KnownStatusCode.OK);
msg.set_response("text/plain", Soup.MemoryUse.COPY,
"TEST!", 4);
return;
}
public void run() {
server.add_handler("/", respond);
server.run();
}
static int main(string[] args) {
var app = new ServerApplication();
app.run();
return 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment