Hi,

> var https = require('http');

require('https')
             ^
:)


On Mon, 6 Feb 2012 20:28:27 -0600, Mark Volkmann <r.mark.volkm...@gmail.com> 
wrote:

> I have a simple HTTPS server that is very similar to the one in the
> documentation for the HTTPS module. When I run it, I get "Error:
> addListener only takes instances of Function" from the createServer call.
> Any idea what I might be doing wrong?
> 
> var fs = require('fs');
> var https = require('http');
> 
> var opts = {
>   key: fs.readFileSync('mykey.pem'),
>   cert: fs.readFileSync('mycert.pem')
> };
> 
> https.createServer(opts, function (req, res) {
>   console.log('url =', req.url);
>   res.statusCode = 200;
>   res.end('Hello, World!');
> }).listen(3002);
> 
> -- 
> R. Mark Volkmann
> Object Computing, Inc.
> 
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en



-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to