diff options
author | Loïc Hoguin <[email protected]> | 2018-04-04 13:13:37 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-04-04 13:13:37 +0200 |
commit | d2a3f2cedd7c00d0933222aed9c06b3149aa4db4 (patch) | |
tree | 4f1499bac639c782b250af0fbf0dec2064315813 /articles/ranch-ftp/index.html | |
parent | 1d654719f5fa6be67d2c95145872068665702cb7 (diff) | |
download | ninenines.eu-d2a3f2cedd7c00d0933222aed9c06b3149aa4db4.tar.gz ninenines.eu-d2a3f2cedd7c00d0933222aed9c06b3149aa4db4.tar.bz2 ninenines.eu-d2a3f2cedd7c00d0933222aed9c06b3149aa4db4.zip |
Cowboy 2.3.0
Diffstat (limited to 'articles/ranch-ftp/index.html')
-rw-r--r-- | articles/ranch-ftp/index.html | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/articles/ranch-ftp/index.html b/articles/ranch-ftp/index.html index 46b3a9c1..c9c8ba94 100644 --- a/articles/ranch-ftp/index.html +++ b/articles/ranch-ftp/index.html @@ -7,7 +7,7 @@ <meta name="description" content=""> <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara"> - <meta name="generator" content="Hugo 0.30.2" /> + <meta name="generator" content="Hugo 0.37.1" /> <title>Nine Nines: Build an FTP Server with Ranch in 30 Minutes</title> @@ -88,7 +88,7 @@ then open a terminal into that directory. The first step is to add Ranch as a dependency. Create the <code>rebar.config</code> file and add the following 3 lines.</p></div> <div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -102,7 +102,7 @@ this file to hardcode the exact version you are using, to make sure you run the same version of dependencies in production.</p></div> <div class="paragraph"><p>You can now fetch the dependencies.</p></div> <div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -118,14 +118,14 @@ article so let’s just move on to writing the protocol itself. Create the file <em>ranch_ftp_protocol.erl</em> and open it in your favorite editor.</p></div> <div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> <pre><tt>$ vim ranch_ftp_protocol<span style="color: #990000">.</span>erl</tt></pre></div></div> <div class="paragraph"><p>Let’s start with a blank protocol module.</p></div> <div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -152,7 +152,7 @@ the shell you will have to repeat the commands to proceed.</p></div> to recompile and reload the code for the protocol. You do not need to restart any process however.</p></div> <div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -161,7 +161,7 @@ Erlang R15B02 <span style="color: #990000">(</span>erts-<span style="color: #993 Eshell V5<span style="color: #990000">.</span><span style="color: #993399">9.2</span> <span style="color: #990000">(</span>abort with <span style="color: #990000">^</span>G<span style="color: #990000">)</span></tt></pre></div></div> <div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -179,7 +179,7 @@ earlier.</p></div> to connect, the server will print a message in the console, and then the client will print an error.</p></div> <div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -189,7 +189,7 @@ http://www.gnu.org/software/src-highlite --> give ownership of the socket to you. This requires a synchronization step though.</p></div> <div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -204,7 +204,7 @@ to authenticate the user, and if the authentication went successfully, which it will always do for the purpose of this article, it will reply with a <code>230</code> code.</p></div> <div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -227,7 +227,7 @@ the following function. The new function is recursive, each call receiving data from the socket and sending a response. For now we will send an error response for all commands the client sends.</p></div> <div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -252,7 +252,7 @@ we will append to the buffer, and then check if we have received a command fully before running it. The code could look similar to the following.</p></div> <div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -293,6 +293,10 @@ binary protocol implementations in just a few lines of code.</p></div> <ul id="articles-nav" class="extra_margin"> + <li><a href="https://ninenines.eu/articles/cowboy-2.3.0/">Cowboy 2.3</a></li> + + + <li><a href="https://ninenines.eu/articles/cowboy-2.2.0/">Cowboy 2.2</a></li> |