<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
>
    <channel>
        <title>Silas Sewell - node.js</title>
        <atom:link href="http://www.silassewell.com/blog/tag/nodejs/rss2.xml" rel="self" type="application/rss+xml" />
        <link>http://www.silassewell.com/blog/tag/nodejs</link>
        <description>Infrastructure Development</description>
        <lastBuildDate>Sat, 08 Jan 2011 00:00:00 GMT</lastBuildDate>
        <generator>http://www.silassewell.com/</generator>
        <language>en</language>
        <sy:updatePeriod>hourly</sy:updatePeriod>
        <sy:updateFrequency>1</sy:updateFrequency>

        <item>
            <title>node.js HTTPS (SSL) Server Example</title>
            <link>http://www.silassewell.com/blog/2010/06/03/node-js-https-ssl-server-example/</link>
            <pubDate>Thu, 03 Jun 2010 00:00:00 GMT</pubDate>
            <dc:creator>silas</dc:creator>
            <category><![CDATA[HTTPS]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[node.js]]></category><category><![CDATA[SSL]]></category>
            <guid isPermaLink="true">http://www.silassewell.com/blog/2010/06/03/node-js-https-ssl-server-example/</guid>
            <description><![CDATA[<p>A simple HTTPS server using node.js:</p>

<pre><code class="prettyprint">const crypto = require('crypto'),
      fs = require("fs"),
      http = require("http");

var privateKey = fs.readFileSync('privatekey.pem').toString();
var certificate = fs.readFileSync('certificate.pem').toString();

var credentials = crypto.createCredentials({key: privateKey, cert: certificate});

var handler = function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
};

var server = http.createServer();
server.setSecure(credentials);
server.addListener("request", handler);
server.listen(8000);
</code></pre>

<p>You can generate the <code class="prettyprint">privatekey.pem</code> and <code class="prettyprint">certificate.pem</code> files using the
following commands:</p>

<pre><code class="prettyprint">openssl genrsa -out privatekey.pem 1024 
openssl req -new -key privatekey.pem -out certrequest.csr 
openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pem
</code></pre>

<p>Update: Thanks to <a href="http://www.geekceo.com/" title="Kord Campbell">Kord Campbell</a> for spotting an issue and sending a fix!</p>]]></description>
        </item>

        <item>
            <title>Auto-reload node.js (OS X)</title>
            <link>http://www.silassewell.com/blog/2010/05/16/auto-reload-node-js-os-x/</link>
            <pubDate>Sun, 16 May 2010 00:00:00 GMT</pubDate>
            <dc:creator>silas</dc:creator>
            <category><![CDATA[JavaScript]]></category><category><![CDATA[node.js]]></category><category><![CDATA[Python]]></category><category><![CDATA[restarter]]></category>
            <guid isPermaLink="true">http://www.silassewell.com/blog/2010/05/16/auto-reload-node-js-os-x/</guid>
            <description><![CDATA[<p><a href="http://github.com/silas/restarter" title="restarter">restarter</a> is a simple Python application which runs a specified
command and restarts the command each time a file event occurs in a specified
directory.</p>

<p>I created restarter because there isn't auto-reload functionality built into
<a href="http://nodejs.org/" title="node.js">node.js</a> (at the time of this post).</p>

<p><strong>Example</strong></p>

<pre><code class="prettyprint">[silas@blackbox keyfu.js]$ restarter node keyfu.js
Express started at http://localhost:3000/ in development mode
</code></pre>

<p><strong>Usage</strong></p>

<pre><code class="prettyprint">Usage: restarter [options] command

Options:
  -h, --help     show this help message and exit
  --path=PATH    directory to watch for file event changes
  --ignore=PATH  specifies events to ignore
</code></pre>]]></description>
        </item>

    </channel>
</rss>
