initial commit

This commit is contained in:
Peter Thorson
2011-09-07 20:27:29 -05:00
commit fa73c478e9
34 changed files with 3581 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
#include "chat.hpp"
using websocketchat::chat_handler;
bool chat_handler::validate(websocketpp::session_ptr client) {
// We only know about the chat resource
if (client->get_request() != "/chat") {
client->set_http_error(404);
return false;
}
// Require specific origin example
if (client->get_header("Sec-WebSocket-Origin") != "http://zaphoyd.com") {
client->set_http_error(403);
return false;
}
return true;
}
void connect(session_ptr client) {
std::cout << "client " << client << " joined the lobby." << std::endl;
m_connections.insert(client);
// send user list to all clients
// send signon message from server to all other clients.
}