Sign inSign up

valda/http2-test

By valda

Updated over 9 years ago

http2 test app listening on port 8080 - works only on http

Image
0

486

valda/http2-test repository overview

http2 test app listening on port 8080 - works only on http

to run you can use: docker run -p 8080:8080 valda/http2-test

server.js file:

var options = {
        plain: true
};

require('http2').raw.createServer(options, function(request, response) {
        response.end('Hello world from HTTP2!');
}).listen(8080);

package.json file:

{
  "name": "nodehttp2",
  "version": "1.0.0",
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
        "http2": "^3.3.6"
  }
}

Dockerfile:

FROM node:7-alpine

# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install

# Bundle app source
COPY server.js /usr/src/app

EXPOSE 8080
CMD [ "npm", "start" ]

Tag summary

Content type

Image

Digest

Size

19.9 MB

Last updated

over 9 years ago

docker pull valda/http2-test