aboutsummaryrefslogtreecommitdiffhomepage
path: root/node_modules/uws/src/addon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/uws/src/addon.cpp')
-rw-r--r--node_modules/uws/src/addon.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/node_modules/uws/src/addon.cpp b/node_modules/uws/src/addon.cpp
new file mode 100644
index 0000000..15e6905
--- /dev/null
+++ b/node_modules/uws/src/addon.cpp
@@ -0,0 +1,24 @@
+#include "../src/uWS.h"
+#include "addon.h"
+#include "http.h"
+
+void Main(Local<Object> exports) {
+ Isolate *isolate = exports->GetIsolate();
+
+ exports->Set(String::NewFromUtf8(isolate, "server"), Namespace<uWS::SERVER>(isolate).object);
+ exports->Set(String::NewFromUtf8(isolate, "client"), Namespace<uWS::CLIENT>(isolate).object);
+ exports->Set(String::NewFromUtf8(isolate, "httpServer"), HttpServer::getHttpServer(isolate));
+
+ NODE_SET_METHOD(exports, "setUserData", setUserData<uWS::SERVER>);
+ NODE_SET_METHOD(exports, "getUserData", getUserData<uWS::SERVER>);
+ NODE_SET_METHOD(exports, "clearUserData", clearUserData<uWS::SERVER>);
+ NODE_SET_METHOD(exports, "getAddress", getAddress<uWS::SERVER>);
+
+ NODE_SET_METHOD(exports, "transfer", transfer);
+ NODE_SET_METHOD(exports, "upgrade", upgrade);
+ NODE_SET_METHOD(exports, "connect", connect);
+ NODE_SET_METHOD(exports, "setNoop", setNoop);
+ registerCheck(isolate);
+}
+
+NODE_MODULE(uws, Main)