2012/2/6 Koichi Kobayashi <koic...@improvement.jp> > 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 >
First sorry my english, i can read, but not write god :P Realy i'dont like mange the ssl and gzip from aplication side, you can use a reverse proxy like nginx or pound for work with ssl/gzip with the client and palin/text comunication with the backends, is a god idea for escalation to. ex, in pound you can: ListenHTTPS Address 50.33.231.23 # public ip Port 443 # public port, https Cert "/etc/pound/server.pem" #cert file Service BackEnd Address 127.0.0.1 #localhost Port 3000 # you app port (http plain) End End End With nginx you can: server { server_name yourdomain.com; listen 443; ssl on; ssl_certificate /usr/local/nginx/conf/server.crt; ssl_certificate_key /usr/local/nginx/conf/server.key; # for static files location ~ \.(jpg|css|js|png|ttf|txt|gif|ico)$ { root /path/of/static } # rest location / { proxy_pass http://lolcahost:3000; # Your app open port proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; # remember use this header for remote addr proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; # to know original protocol usage } } -- El Tio ~ Programador, hacker y filósofo web: http://blog.exodica.com.ar Linked'in: http://www.linkedin.com/in/ogentilezza Twitter: @exos <http://twitter.com/exos>, Indeti.ca: @exos<http://identi.ca/exos> Tels: [+54 11] 638-LINUX (54689) - [+54 9 11] 6799-4797 -- 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