SPDY server on Node.js

Overview

SPDY Server for node.js

Build Status NPM version dependencies Status Standard - JavaScript Style Guide Waffle

With this module you can create HTTP2 / SPDY servers in node.js with natural http module interface and fallback to regular https (for browsers that don't support neither HTTP2, nor SPDY yet).

This module named spdy but it provides support for both http/2 (h2) and spdy (2,3,3.1). Also, spdy is compatible with Express.

Usage

Examples

Server:

var spdy = require('spdy'),
    fs = require('fs');

var options = {
  // Private key
  key: fs.readFileSync(__dirname + '/keys/spdy-key.pem'),

  // Fullchain file or cert file (prefer the former)
  cert: fs.readFileSync(__dirname + '/keys/spdy-fullchain.pem'),

  // **optional** SPDY-specific options
  spdy: {
    protocols: [ 'h2', 'spdy/3.1', ..., 'http/1.1' ],
    plain: false,

    // **optional**
    // Parse first incoming X_FORWARDED_FOR frame and put it to the
    // headers of every request.
    // NOTE: Use with care! This should not be used without some proxy that
    // will *always* send X_FORWARDED_FOR
    'x-forwarded-for': true,

    connection: {
      windowSize: 1024 * 1024, // Server's window size

      // **optional** if true - server will send 3.1 frames on 3.0 *plain* spdy
      autoSpdy31: false
    }
  }
};

var server = spdy.createServer(options, function(req, res) {
  res.writeHead(200);
  res.end('hello world!');
});

server.listen(3000);

Client:

var spdy = require('spdy');
var https = require('https');

var agent = spdy.createAgent({
  host: 'www.google.com',
  port: 443,

  // Optional SPDY options
  spdy: {
    plain: false,
    ssl: true,

    // **optional** send X_FORWARDED_FOR
    'x-forwarded-for': '127.0.0.1'
  }
});

https.get({
  host: 'www.google.com',
  agent: agent
}, function(response) {
  console.log('yikes');
  // Here it goes like with any other node.js HTTP request
  // ...
  // And once we're done - we may close TCP connection to server
  // NOTE: All non-closed requests will die!
  agent.close();
}).end();

Please note that if you use a custom agent, by default all connection-level errors will result in an uncaught exception. To handle these errors subscribe to the error event and re-emit the captured error:

var agent = spdy.createAgent({
  host: 'www.google.com',
  port: 443
}).once('error', function (err) {
  this.emit(err);
});

Push streams

It is possible to initiate PUSH_PROMISE to send content to clients before the client requests it.

spdy.createServer(options, function(req, res) {
  var stream = res.push('/main.js', {
    status: 200, // optional
    method: 'GET', // optional
    request: {
      accept: '*/*'
    },
    response: {
      'content-type': 'application/javascript'
    }
  });
  stream.on('error', function() {
  });
  stream.end('alert("hello from push stream!");');

  res.end('');
}).listen(3000);

PUSH_PROMISE may be sent using the push() method on the current response object. The signature of the push() method is:

.push('/some/relative/url', { request: {...}, response: {...} }, callback)

Second argument contains headers for both PUSH_PROMISE and emulated response. callback will receive two arguments: err (if any error is happened) and a Duplex stream as the second argument.

Client usage:

var agent = spdy.createAgent({ /* ... */ });
var req = http.get({
  host: 'www.google.com',
  agent: agent
}, function(response) {
});
req.on('push', function(stream) {
  stream.on('error', function(err) {
    // Handle error
  });
  // Read data from stream
});

NOTE: You're responsible for the stream object once given it in .push() callback or push event. Hence ignoring error event on it will result in uncaught exception and crash your program.

Trailing headers

Server usage:

function (req, res) {
  // Send trailing headers to client
  res.addTrailers({ header1: 'value1', header2: 'value2' });

  // On client's trailing headers
  req.on('trailers', function(headers) {
    // ...
  });
}

Client usage:

var req = http.request({ agent: spdyAgent, /* ... */ }).function (res) {
  // On server's trailing headers
  res.on('trailers', function(headers) {
    // ...
  });
});
req.write('stuff');
req.addTrailers({ /* ... */ });
req.end();

Options

All options supported by tls work with node-spdy.

Additional options may be passed via spdy sub-object:

  • plain - if defined, server will ignore NPN and ALPN data and choose whether to use spdy or plain http by looking at first data packet.
  • ssl - if false and options.plain is true, http.Server will be used as a base class for created server.
  • maxChunk - if set and non-falsy, limits number of bytes sent in one DATA chunk. Setting it to non-zero value is recommended if you care about interleaving of outgoing data from multiple different streams. (defaults to 8192)
  • protocols - list of NPN/ALPN protocols to use (default is: ['h2','spdy/3.1', 'spdy/3', 'spdy/2','http/1.1', 'http/1.0'])
  • protocol - use specific protocol if no NPN/ALPN ex In addition,
  • maxStreams - set "maximum concurrent streams" protocol option

API

API is compatible with http and https module, but you can use another function as base class for SPDYServer.

spdy.createServer(
  [base class constructor, i.e. https.Server],
  { /* keys and options */ }, // <- the only one required argument
  [request listener]
).listen([port], [host], [callback]);

Request listener will receive two arguments: request and response. They're both instances of http's IncomingMessage and OutgoingMessage. But three custom properties are added to both of them: isSpdy, spdyVersion. isSpdy is true when the request was processed using HTTP2/SPDY protocols, it is false in case of HTTP/1.1 fallback. spdyVersion is either of: 2, 3, 3.1, or 4 (for HTTP2).

Contributors

LICENSE

This software is licensed under the MIT License.

Copyright Fedor Indutny, 2015.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • SPDY fails in node >= 11.1.0

    SPDY fails in node >= 11.1.0

    Hi,

    Couple of short investigation, why SPDY drop error message //------------------------------------------------------------------------------------------------------- buffer.js:72 class FastBuffer extends Uint8Array {} ^

    RangeError: Invalid typed array length: -104 at new Uint8Array () at new FastBuffer (buffer.js:72:1) at Handle.onStreamRead [as onread] (internal/stream_base_commons.js:121:17) at Immediate. (/home/bhevesi/node_modules/handle-thing/lib/handle.js:128:16) at processImmediate (timers.js:632:19) //------------------------------------------------------------------------------------------------------- using new version (11) of node.js.

    I found that node internal/stream_base_commons.js has been changed in new version but the SPDY dependency ("handle-thing": "^1.2.5") is not properly call it in /lib/handles.js file.

    In Node, function onStreamRead(arrayBuffer) called from handles.js via self.onread(uv.UV_EOF, new Buffer(0)) and self.onread(uv.UV_ECONNRESET, new Buffer(0)). So the given two parameters (instead of one) generates error.

    In order to eliminate these errors, I had some changes in /lib/handles.js file: Replaced "self.onread(uv.UV_EOF, new Buffer(0))" to self.onread(new Buffer(0)) and self.onread(uv.UV_ECONNRESET, new Buffer(0)) to self.onread(new Buffer(0))

    Looks errors are disappears but more deep investigation required or/and live maintenance of "handle-thing": "^1.2.5" module

    Best regards: Bela

    bug 
    opened by bhevesi 42
  • Huge problems with serving bigger site with SPDY

    Huge problems with serving bigger site with SPDY

    Firstly, I am using node 0.11.9 (will try git) and node-http-proxy#caronte to get the content. I am sure it works all right, I have no problems with it with ordinary https or http. However with node-spdy it seems that the data is being cut in the middle of some requests. Firebug shows lots of requests and aborted and Chrome seems to work a bit better, but flawed as well. While running into problems I get few types of exceptions. I will try to make some "minimal" testcase but I would like to know your opinion as soon as you could give one.

    This is the url being run with node-spdy: https://jira-nowaker.atlashost.eu:8443/secure/Dashboard.jspa <- with Firefox it is most apparent and with Chrome it sometimes requires a few refreshes

    [Uncought exception] TypeError: Property 'onIncoming' of object #<HTTPParser> is not a function
        at HTTPParser.parserOnHeadersComplete (_http_common.js:111:23)
        at Socket.socketOnData (_http_client.js:272:20)
        at Socket.EventEmitter.emit (events.js:98:17)
        at readableAddChunk (_stream_readable.js:156:16)
        at Socket.Readable.push (_stream_readable.js:123:10)
        at TCP.onread (net.js:509:20)
    
    [Uncought exception] AssertionError: null == true
        at Socket.socketOnData (_http_client.js:270:3)
        at Socket.EventEmitter.emit (events.js:98:17)
        at readableAddChunk (_stream_readable.js:156:16)
        at Socket.Readable.push (_stream_readable.js:123:10)
        at TCP.onread (net.js:509:20)
    
    [Uncought exception] Error: stream.push() after EOF
        at readableAddChunk (_stream_readable.js:142:15)
        at IncomingMessage.Readable.push (_stream_readable.js:123:10)
        at HTTPParser.parserOnBody (_http_common.js:132:22)
        at Socket.socketOnData (_http_client.js:272:20)
        at Socket.EventEmitter.emit (events.js:98:17)
        at Socket.Readable.read (_stream_readable.js:366:10)
        at Socket.socketCloseListener (_http_client.js:194:10)
        at Socket.EventEmitter.emit (events.js:120:20)
        at TCP.close (net.js:459:12)
    
    [Uncought exception] Error: stream.push() after EOF
        at readableAddChunk (_stream_readable.js:142:15)
        at IncomingMessage.Readable.push (_stream_readable.js:123:10)
        at HTTPParser.parserOnBody (_http_common.js:132:22)
        at Socket.socketOnData (_http_client.js:272:20)
        at Socket.EventEmitter.emit (events.js:98:17)
        at readableAddChunk (_stream_readable.js:156:16)
        at Socket.Readable.push (_stream_readable.js:123:10)
        at TCP.onread (net.js:509:20)
    

    After testing with git version I get only this exception (but SPDY works as badly as before):

    [Uncought exception] Error: stream.push() after EOF
        at readableAddChunk (_stream_readable.js:142:15)
        at IncomingMessage.Readable.push (_stream_readable.js:123:10)
        at HTTPParser.parserOnBody (_http_common.js:132:22)
        at Socket.socketOnData (_http_client.js:277:20)
        at Socket.EventEmitter.emit (events.js:101:17)
        at Socket.Readable.read (_stream_readable.js:366:10)
        at Socket.socketCloseListener (_http_client.js:196:10)
        at Socket.EventEmitter.emit (events.js:123:20)
        at TCP.close (net.js:459:12)
    
    opened by Rush 40
  • 1.10 issue

    1.10 issue

    I had to revert back to the previous version when I upgraded my site here - http://jspm.io/.

    Some responses were just randomly closing the connection before finishing the streams. Sometimes a full script would load, other times it would be cut off.

    It may have something to do with the order of having the push streams run at the same time as the main response stream (it seemed to happen for the push files more easily).

    But I haven't been able to work out exactly what was going on. I will look into this further next week with more info, just a heads up that there are some serious issues in the release.

    opened by guybedford 28
  • undefined symbol: ev_rt_now

    undefined symbol: ev_rt_now

    I'm getting the following error when trying to run the test spdy-server:

    hynese@hynese:/home/hynese/spdy# node spdy-server.js

    node.js:183 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: /home/hynese/spdy/node_modules/zlibcontext/lib/zlib_bindings.node: undefined symbol: ev_rt_now at Object..node (module.js:472:11) at Module.load (module.js:339:31) at Function._load (module.js:298:12) at require (module.js:367:19) at Object. (/home/hynese/spdy/node_modules/zlibcontext/lib/zlib.js:1:88) at Module._compile (module.js:427:26) at Object..js (module.js:466:10) at Module.load (module.js:339:31) at Function._load (module.js:298:12) at require (module.js:367:19)

    Any insight is greatly appreciated,

    opened by ghost 27
  • Gzip compression error

    Gzip compression error

    I've tried testing spdy with gzipped content. Unfortunately, instead of ungzipping it, Chrome throws the error net::ERR_SPDY_COMPRESSION_ERROR.

    spdy.createServer(options, function(req, res) {
      var stream = res.push('/main.js', {
        request: {
          accept: '*/*'
        },
        response: {
          'content-type': 'application/javascript',
          'content-encoding' : 'gzip',
        }
      });
      stream.on('error', function() {
      });
      stream.end(zlib.gzipSync('alert("hello from push stream!");'));
    
      res.end('<script src="/main.js"></script>');
    }).listen(3000);
    
    opened by lewispham 24
  • Can't make HTTP2 work with koa

    Can't make HTTP2 work with koa

    Hi, i need a bit of help because this isn't working but first, a question:

    It is possible to use HTTP2 without SSL/certificates? The use case is communicating with haproxy in a secure network (haproxy does SSL termination)

    If it's possible, setting plain: false makes the server always return "empty reply from server"

    opened by felixsanz 22
  • Server crashes after 8k concurrent users, even though there's already 13.45s timeout

    Server crashes after 8k concurrent users, even though there's already 13.45s timeout

    The SPDY installation crashes after having 8k (7565) concurrent users accessing the server.

    See http://data.sly.mn/OEtT.

    I don't know what to do in this situation as having the system crash without only experiencing large timeouts opens an attack vector for DDoS..

    To check yourself, https://sly.mn/ — a just checkedout (1 hour ago) SPDY installation.

    Thanks for any help!

    Edit: The server doesn't crash, it just doesn't do anything anymore. It's now a zombie process on the server.

    opened by 19h 21
  • Assertion Error when serving static files with Express

    Assertion Error when serving static files with Express

    Can it serve static files coupled with Express 4? I encountered Assertion Error when refreshing the page. However no such issue when using Node's own HTTPS.

    require('https') => serving static files without any issues. require('spdy') => AssertionError.

    assert.js:89
      throw new assert.AssertionError({
      ^
    AssertionError: false == true
        at PriorityNode.removeChild (/home/motss/wotss/serve-static/node_modules/spdy-transport/lib/spdy-transport/priority.js:71:3)
        at PriorityNode.remove (/home/motss/wotss/serve-static/node_modules/spdy-transport/lib/spdy-transport/priority.js:60:15)
        at PriorityTree.add (/home/motss/wotss/serve-static/node_modules/spdy-transport/lib/spdy-transport/priority.js:153:23)
        at Stream._initPriority (/home/motss/wotss/serve-static/node_modules/spdy-transport/lib/spdy-transport/stream.js:101:25)
        at new Stream (/home/motss/wotss/serve-static/node_modules/spdy-transport/lib/spdy-transport/stream.js:75:8)
        at Connection._createStream (/home/motss/wotss/serve-static/node_modules/spdy-transport/lib/spdy-transport/connection.js:392:16)
        at Connection._handleHeaders (/home/motss/wotss/serve-static/node_modules/spdy-transport/lib/spdy-transport/connection.js:439:21)
        at Connection._handleFrame (/home/motss/wotss/serve-static/node_modules/spdy-transport/lib/spdy-transport/connection.js:322:10)
        at Parser.<anonymous> (/home/motss/wotss/serve-static/node_modules/spdy-transport/lib/spdy-transport/connection.js:161:10)
        at emitOne (events.js:77:13)
    
    opened by motss 20
  • Protocol error on push promise

    Protocol error on push promise

    I got the protocol error while I was trying to push multiple files via PUSH_PROMISE. Here is the sample code.

    spdy.createServer(options, function(req, res) {
        ['/app/main.js','/app/main.css','/app/favicon-32x32.png'].forEach(function(url){
            console.log('fetching',url);
          var stream = res.push(url, {
              'content-type': `${MIME[url.substr(url.lastIndexOf('.')+1)]};charset=utf-8`,
              'content-encoding' : 'gzip',
            });
          stream.on('error', function(er) {
              throw er;
          });
          var fstream = fs.createReadStream('/home'+url);
          fstream.pipe(stream);
        });
    
    
      res.end(`
        <!DOCTYPE html>
        <html>
            <head>
                <script src="/app/main.js" async></script>
                <link rel="stylesheet" href="/app/main.css" async>
                <link rel="icon" type="image/png" href="/app/favicon-32x32.png" sizes="32x32" async>
                <meta name="viewport" content="width=device-width, initial-scale=1">
            </head>
            <body></body>
        </html>`
      );
    

    Result: untitled

    Anything wrong with my code? Or is this a node-spdy bug?

    opened by lewispham 20
  • XHR2 Upload speeds a lot slower in SPDY than in node's TLS.

    XHR2 Upload speeds a lot slower in SPDY than in node's TLS.

    I'm doing multipart/form-data uploads over XHR2 to a node server and noticed a pretty big performance drop (~80MB/s to ~2MB/s on localhost) by just switching from require("https") to require("spdy"). Download speeds seemed unaffected.

    From a quick look in Process Explorer it seems the node process is fully eating a core during uploads and spending a lot of time in node.exe!v8::OutputStream::GetOutputEncoding+0x2e6fc. It isn't Windows-specific though, as I had it happen on a Linux server too. If you need any more details, just ask, or just take a look at my app.

    opened by silverwind 20
  • Firefox push issue

    Firefox push issue

    I have the following loading process:

      https://jspm.io/system.js -> https://jspm.io/[email protected] (301 redirect)
      https://[email protected] SPDY pushes https://jspm.io/[email protected]
    

    This works fine in Chrome, but on Firefox, sporadically the request will stall and never end (keeps spinning).

    This looks quite similar to the issue in https://github.com/indutny/node-spdy/issues/158

    Any ideas appreciated. Edge cases like this kill the workflow quite badly.

    opened by guybedford 19
  • Not able to instrument SPDY

    Not able to instrument SPDY

    Hi,

    I am working on a project where I need to instrument the SPDY framework code to get access to request and response. This is for application performance monitoring purposes. I have successfully able to instrument other frameworks (expressjs etc...) without any issues. Seeing an issue (getting net::ERR_HTTP2_PROTOCOL_ERROR error in the browser for some of the resources) while instrumenting the SPDY framework code. I have double checked that the issue is not in the post instrumentational code. The act of instrumenting SPDY framework creates an issue so I believe it is something to do with the SPDY framework. The issue is not happening at all the times it is random. image

    I also noticed some similar issue reported by another person as well. https://github.com/spdy-http2/node-spdy/issues/380

    Following are the versions of my environment. NodeJS : 16.13.1 ExpressJS : 4.18.1 SPDY : 4.0.2 OS : Windows 10 Pro 21H1 (Build 19043.1826)

    Please find attached, simple example project that we have created to replicate and understand issue. spdy-instrumentation-poc.zip

    opened by ashokduraikeg 0
  • [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

    [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

    Bump into the following deprecation warning in the following code snippet:

    healthchecks.get('/live', function (req, res, next) {
      res.send('OK')
    });
    
    [nodejsrestapi-1] (node:1) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated 
    [nodejsrestapi-1]     at ServerResponse.writeHead (/app/node_modules/spdy/lib/spdy/response.js:18:12) 
    [nodejsrestapi-1]     at ServerResponse.writeHead (/app/node_modules/on-headers/index.js:44:26) 
    [nodejsrestapi-1]     at ServerResponse.writeHead (/app/node_modules/on-headers/index.js:44:26) 
    [nodejsrestapi-1]     at ServerResponse.writeHead (/app/node_modules/on-headers/index.js:44:26) 
    [nodejsrestapi-1]     at ServerResponse._implicitHeader (node:_http_server:287:8) 
    [nodejsrestapi-1]     at ServerResponse.end (/app/node_modules/compression/index.js:103:14) 
    [nodejsrestapi-1]     at ServerResponse.send (/app/node_modules/express/lib/response.js:232:10) 
    [nodejsrestapi-1]     at file:///app/src/webapi/routes/healthchecks.js:23:9 
    [nodejsrestapi-1]     at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) 
    [nodejsrestapi-1]     at next (/app/node_modules/express/lib/router/route.js:144:13)
    

    "spdy": "^4.0.2" "express": "^4.18.1", Node: v18.7.0 https://github.com/expressjs/express/issues/4976

    opened by khteh 0
  • Cannot read property 'chunk' of null

    Cannot read property 'chunk' of null

    Hi folks,

    I'm using spdy 4.0.2 for a while now with node 14.17.5 (on MacOs) and all seems to be working just fine except that whenever something in the network changes (mostly when my vpn connection stops or reconnects) I get this trace:

    TypeError: Cannot read property 'chunk' of null
        at Socket.bytesWritten (net.js:819:17)
        at Socket.socketOnError (_http_server.js:642:31)
        at Socket.emit (events.js:400:28)
        at Socket.emit (domain.js:470:12)
        at Stream.onStreamError (/Users/xproject/2021.4/node_modules/spdy/lib/spdy/handle.js:110:18)
        at Stream.emit (events.js:400:28)
        at Stream.emit (domain.js:470:12)
        at errorOrDestroy (/Users/x/project/2021.4/node_modules/spdy-transport/node_modules/readable-stream/lib/internal/streams/destroy.js:98:101)
        at onwriteError (/Users/x/project/2021.4/node_modules/spdy-transport/node_modules/readable-stream/lib/_stream_writable.js:424:5)
        at onwrite (/Users/x/project/2021.4/node_modules/spdy-transport/node_modules/readable-stream/lib/_stream_writable.js:450:11)
    error Command failed with exit code 1.
    

    We use spdy in combination with webpack to create a proxy. Statics files are served by webpack dev server and api calls are sent to a remote server. We didn't get this when we were still using express.

    Any suggestions to help fix this are welcome.

    Cheers, Danny

    opened by dannybloe 0
  • Failing to send HTTP/1.0 POST request

    Failing to send HTTP/1.0 POST request

    Failing to send a HTTP/1.0 post request. Getting the following error.

    TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"
        at new NodeError (node:internal/errors:329:5)
        at new ClientRequest (node:_http_client:168:11)
        at Object.request (node:http:52:10)
        at /Users/yash/elocity/utilityportal-backend/src/ocpp/command/CommandStateManager.ts:167:43
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (node:internal/process/task_queues:94:5) {
      code: 'ERR_INVALID_PROTOCOL'
    }
    

    Configuration of the agent and http request client:

    const agentConfig = {
    	host: domain,
    	port: Number.isNaN(port) ? 80 : +port,
    	spdy: {
    		protocols: ["http/1.0"],
    		ssl: false
    	},
    };
    const agent = spdy.createAgent(agentConfig);
    const httpOptions = {
    	agent,
    	method: "POST",
    	path,
    	headers: {
    		"Content-Type": "application/xml",
    		"Content-Length": Buffer.byteLength(client.lastRequest),
    	},
    	protocol: "http:",
    	port: Number.isNaN(port) ? 80 : +port,
    };
    const post_req = http.request(httpOptions, function (res) {
    	res.setEncoding("utf8");
    	var result = "";
    	res.on("data", function (chunk) {
    		result += chunk;
    	});
    	res.on("end", function () {
    		console.log(result);
    	});
    });
    post_req.removeHeader("Transfer-Encoding");
    post_req.on("error", function (err) {
    	console.log(err);
    });
    post_req.write(client.lastRequest);
    post_req.end();
    })
    

    I am not really familiar with making HTTP/1.0 request so any help regarding this would be greatly appreciated.

    opened by yashpatel20 1
  • Long requests can fail to send data, unless DEBUG env var set

    Long requests can fail to send data, unless DEBUG env var set

    I've set up a test case here: https://github.com/canadaduane/spdy-braidify-heisenbug

    In short: when a long, chunked GET request sends data, it's possible to get in a state where data is no longer sent, even when additional write events occur. I'm having trouble identifying the root cause, but the above test case makes the situation reproducible & should help anyone with internal knowledge of node-spdy.

    Strangely, when adding DEBUG=* or more specifically, DEBUG=spdy:stream:server, the problem disappears.

    opened by canadaduane 0
  • Server unreachable when running in Docker container

    Server unreachable when running in Docker container

    I'm currently working on a small hobby project and wanted to use spdy to add support for HTTP/2. While working fine when running the application standalone, the server seems to be unreachable when being run in a Docker container.

    The Node.js application does not show any log output, even with DEBUG=* set.

    Here is some environment information:

    • Node.js: v14.15.5
    • Spdy: v4.0.2
    • OS: Linux 5.4.0-62-generic # 70-Ubuntu x86_64
    opened by axelrindle 0
Owner
SPDY & HTTP2 in JavaScript
Implementation of both SPDY and HTTP2 Protocols in JavaScript
SPDY & HTTP2 in JavaScript
HTTP server mocking and expectations library for Node.js

Nock HTTP server mocking and expectations library for Node.js Nock can be used to test modules that perform HTTP requests in isolation. For instance,

Nock 11.9k Jan 3, 2023
Node.js web server framework for Http/1.1 or Http/2

Node.js web server framework for Http/1.1 or Http/2 Description: This is http framework, you can use it to create Http/1.1 or Http/2 service。 Now let'

Jeremy Yu 10 Mar 24, 2022
Run Node.js on Android by rewrite Node.js in Java

node-android Run Node.js on Android by rewrite Node.js in Java with the compatible API. third-party: libuvpp, libuv-java JNI code by Oracle. Build Clo

AppNet.Link 614 Nov 15, 2022
:dash: Simple yet powerful file-based mock server with recording abilities

?? smoke Simple yet powerful file-based mock server with recording abilities Just drop a bunch of (JSON) files in a folder and you're ready to go! Bas

Yohan Lasorsa 159 Dec 13, 2022
An HTTP Web Server for Chrome (chrome.sockets API)

An HTTP Web Server for Chrome (chrome.sockets API)

Kyle Graehl 1.2k Dec 31, 2022
A server side agnostic way to stream JavaScript.

JS in JSN A server side agnostic way to stream JavaScript, ideal for: inline hydration network free ad-hoc dependencies bootstrap on demand libraries

Andrea Giammarchi 26 Nov 21, 2022
A TurboRepo local cache server which uploads artifact cache to GH artifacts.

TurboRepo Github Artifacts action This action allows you use Github artifacts as TurboRepo remote cache server. How it works? It's starts a local Turb

Felix Mosheev 65 Dec 18, 2022
Promise based HTTP client for the browser and node.js

axios Promise based HTTP client for the browser and node.js New axios docs website: click here Table of Contents Features Browser Support Installing E

axios 98k Dec 31, 2022
Ajax for Node.js and browsers (JS HTTP client)

superagent Small progressive client-side HTTP request library, and Node.js module with the same API, supporting many high-level HTTP client features T

Sloth 16.2k Jan 1, 2023
A full-featured http proxy for node.js

node-http-proxy node-http-proxy is an HTTP programmable proxying library that supports websockets. It is suitable for implementing components such as

http ... PARTY! 13.1k Jan 3, 2023
🌐 Human-friendly and powerful HTTP request library for Node.js

Sindre's open source work is supported by the community. Special thanks to: Human-friendly and powerful HTTP request library for Node.js Moving from R

Sindre Sorhus 12.5k Jan 9, 2023
Isomorphic WHATWG Fetch API, for Node & Browserify

isomorphic-fetch Fetch for node and Browserify. Built on top of GitHub's WHATWG Fetch polyfill. Warnings This adds fetch as a global so that its API i

Matt Andrews 6.9k Jan 2, 2023
A light-weight module that brings the Fetch API to Node.js

A light-weight module that brings Fetch API to Node.js. Consider supporting us on our Open Collective: Motivation Features Difference from client-side

Node Fetch 8.1k Jan 4, 2023
libcurl bindings for Node.js

node-libcurl The fastest URL transfer library for Node.js. libcurl bindings for Node.js. libcurl official description: libcurl is a free and easy-to-u

Jonathan Cardoso 565 Jan 2, 2023
Full-featured, middleware-oriented, programmatic HTTP and WebSocket proxy for node.js

rocky A multipurpose, full-featured, middleware-oriented and hackable HTTP/S and WebSocket proxy with powerful built-in features such as versatile rou

Tom 370 Nov 24, 2022
Simplifies node HTTP request making.

Requestify - Simplifies node HTTP request making. Requestify is a super easy to use and extendable HTTP client for nodeJS + it supports cache (-:. Ins

Ran Mizrahi 222 Nov 28, 2022
A fully-featured Node.js REST client built for ease-of-use and resilience

flashheart A fully-featured Node.js REST client built for ease-of-use and resilience flashheart is built on http-transport to provide everything you n

BBC 118 Jun 21, 2022
Run HTTP over UDP with Node.js

nodejs-httpp - Run HTTP over UDP based transport and Bring Web in Peer or P2P styles main js modules: udt.js, httpp.js, udts.js and httpps.js, that's

AppNet.Link 142 Aug 2, 2022
一个基于node.js,express,socket.io的websocket非常棒的聊天室,代码简单很适合新手. A very nice websocket chat room based on node.js, express, socket.io. the code is simple, very suitable for novices

来来往下看,虽然教程又臭又长但是一步步地保姆式教学很简单的,毕竟我是真菜鸟嘛,当然什么都往细了说╮(╯_╰)╭ 一、使用方法 该教程内容所有指令都为Linux CentOS 7.x环境下指令,其他平台请您自行查询(⊙x⊙;) 1.下载node.js并下载Sakura_Chat_Room node.j

樱樱怪 10 Jul 21, 2022