{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/io.js/issues/2017","labels_url":"https://api.github.com/repos/nodejs/io.js/issues/2017/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/io.js/issues/2017/comments","events_url":"https://api.github.com/repos/nodejs/io.js/issues/2017/events","html_url":"https://github.com/nodejs/io.js/issues/2017","id":89490934,"number":2017,"title":"NPNProtocols docs need clarification / example","user":{"login":"coolaj86","id":122831,"avatar_url":"https://avatars.githubusercontent.com/u/122831?v=3","gravatar_id":"","url":"https://api.github.com/users/coolaj86","html_url":"https://github.com/coolaj86","followers_url":"https://api.github.com/users/coolaj86/followers","following_url":"https://api.github.com/users/coolaj86/following{/other_user}","gists_url":"https://api.github.com/users/coolaj86/gists{/gist_id}","starred_url":"https://api.github.com/users/coolaj86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolaj86/subscriptions","organizations_url":"https://api.github.com/users/coolaj86/orgs","repos_url":"https://api.github.com/users/coolaj86/repos","events_url":"https://api.github.com/users/coolaj86/events{/privacy}","received_events_url":"https://api.github.com/users/coolaj86/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/io.js/labels/doc","name":"doc","color":"006b75"},{"url":"https://api.github.com/repos/nodejs/io.js/labels/tls","name":"tls","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-06-19T07:26:47Z","updated_at":"2015-06-23T16:32:00Z","closed_at":null,"body":"@indutny The documentation on the HTTPS page refers to the TLS page which fails to give an example (obviously 'hello' and 'world' are not true internet protocols).\r\n\r\nI'm assuming that it should be something like this:\r\n\r\n```javascript\r\nhttps.createServer({\r\n  key: fs.readFileSync(path.join(certsPath, 'my-server.key.pem'))\r\n, cert: fs.readFileSync(path.join(certsPath, 'my-server.crt.pem'))\r\n, ca: [\r\n    fs.readFileSync(path.join(caCertsPath, 'intermediate.crt.pem'))\r\n  , fs.readFileSync(path.join(caCertsPath, 'root.crt.pem'))\r\n  ]\r\n\r\n  , NPNProtocols: ['http/2.0', 'spdy', 'http/1.1', 'http/1.0']\r\n\r\n});\r\n```\r\n\r\nBut I'm not sure if 'http/2.0' is a valid option or how I would pass off http/2.0 requests to the http/2.0 handler, etc (I'm assuming that no http2 module has yet to make it into core yet)."},"comment":{"url":"https://api.github.com/repos/nodejs/io.js/issues/comments/114564497","html_url":"https://github.com/nodejs/io.js/issues/2017#issuecomment-114564497","issue_url":"https://api.github.com/repos/nodejs/io.js/issues/2017","id":114564497,"user":{"login":"indutny","id":238531,"avatar_url":"https://avatars.githubusercontent.com/u/238531?v=3","gravatar_id":"","url":"https://api.github.com/users/indutny","html_url":"https://github.com/indutny","followers_url":"https://api.github.com/users/indutny/followers","following_url":"https://api.github.com/users/indutny/following{/other_user}","gists_url":"https://api.github.com/users/indutny/gists{/gist_id}","starred_url":"https://api.github.com/users/indutny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indutny/subscriptions","organizations_url":"https://api.github.com/users/indutny/orgs","repos_url":"https://api.github.com/users/indutny/repos","events_url":"https://api.github.com/users/indutny/events{/privacy}","received_events_url":"https://api.github.com/users/indutny/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T16:32:00Z","updated_at":"2015-06-23T16:32:00Z","body":"I'm with @shigeki here, it is really simple to implement and is only a matter of a couple of lines of code. Emitting random-named events on the server seems to be a bad idea to me, especially considering that the user may supply any protocol name to the NPN. Even `secureConnection` ;)"}}