uWSGI V8 support

Building

You will need the libv8 headers to build the plugin. The official modifier1 value for V8 is ‘24’.

RPC

  1. function part1(request_uri, remote_addr) {
  2. return '<h1>i am part1 for ' + request_uri + ' ' + remote_addr + "</h1>" ;
  3. }
  4.  
  5. function part2(request_uri, remote_addr) {
  6. return '<h2>i am part2 for ' + request_uri + ' ' + remote_addr + "</h2>" ;
  7. }
  8.  
  9. function part3(request_uri, remote_addr) {
  10. return '<h3>i am part3 for ' + request_uri + ' ' + remote_addr + "</h3>" ;
  11. }
  12.  
  13. uwsgi.register_rpc('part1', part1);
  14. uwsgi.register_rpc('part2', part2);
  15. uwsgi.register_rpc('part3', part3);
  16.  
  17. ciao = function(saluta) {
  18. uwsgi.log("I have no idea what's going on.");
  19. return "Ciao Ciao";
  20. }
  21.  
  22. uwsgi.register_rpc('hello', ciao);

Signal handlers

  1. function tempo(signum) {
  2. uwsgi.log("e' passato 1 secondo");
  3. }
  4.  
  5. uwsgi.register_signal(17, '', tempo);

Multitheading and multiprocess

Mules

The uWSGI API

JSGI 3.0

  1. exports.app = function (request) {
  2. uwsgi.log("Hello! I am the app.\n");
  3. uwsgi.log(request.scheme + ' ' + request.method + ' ' + request.scriptName + ' ' + request.pathInfo + ' ' + request.queryString + ' ' + request.host);
  4. uwsgi.log(request.serverSoftware);
  5. return {
  6. status: 200,
  7. headers: {"Content-Type": "text/plain", "Server": ["uWSGI", "v8/plugin"]},
  8. body: ["Hello World!", "I am V8"]
  9. };
  10. }
  1. uwsgi --plugin v8 --v8-jsgi myapp.js --http-socket :8080 --http-socket-modifier1 24

CommonJS

  • Require: OK
  • Binary/B: NO
  • System/1.0: in progress
  • IO/A: NO
  • Filesystem/A: NO