SSLでCookie使う場合はsecure属性つけて非SSLの場合にはCookie送信しないようにするって仕組みがあるわけだけど、connectのsessionもその実装はされてる。 app.use(express.session({ secret: yourSecret, cookie: { secure: true } })); こんな感じ(コードはexpressだけど)。で、こうするとSSLの場合だけCookieが有効になるはずなんだけど、herokuでやってたらSSLのときも有効にならなくて(Set-Cookieされない)なんぞと思って調べてみた。 現状(v1.8.5)のmiddleware/session.jsの該当のコードはこうなってる。 // only send secure session cookies when there is a secure connection.
This tutorial is a hands on, practical introduction to writing Express 3 applications complete with CSRF protection. As a bonus, it should be fairly easy to install on Heroku. Prerequisites A working Node installation is assumed, and basic knowledge of Node and the command-line. Getting Started Create a new directory, then create a new file called package.json that looks like this: { "author": "Al
最近仕事ではNode.jsしか書いてないtoritoriです。 お仕事でもexpressやsocket.ioを使っているのですが WebアプリケーションのテストについてWeb上にあまり書かれていないような気がします。 特にソケット接続した後のメッセージ送信/受信の部分です。 今までのようなHTTPの単純なリクエスト/レスポンスとは手法が異なりますしどうしたものかと。 そこで「自分はこんな感じでテストしてますよー」という記事を書いてみます。 裏を返せば「もっといい方法あるよ!」というのを聞きたいのです>< サンプルについて socket.ioのexample を使います。 ただし、サンプルではログイン時に遷移しない方式なので もう少し実用的な動作に近づかせるため あえてログインURLから遷移するようにし、 セッションもRedisを使うようにしてexpressとsocket.ioでセッションを
Captcha security check restifyjs is for sale Please prove you're not a robot View Price
100ミリ秒のウェイトが入るHelloWorldPHP<?php usleep(100000); echo "Hello World"; ?> Node.jsvar http = require('http') server = http.createServer() server.on('request', function(req, res){ setTimeout(function(){ res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('Hello World'); res.end() }, 100) }) server.listen(3000, '127.0.0.1'); console.log('Server running at http://127.0.0.1:3000/'); 実行を忘れずに
支えた技術ってほど大層なものでもないんだけど、なんとなくカッコいいのでシリーズ名にしてみようと思った。 で、表題の件。 #isucon のベンチマークツールは1台のmasterと複数台のagentという構造になっていて、agentはベンチマークツールの負荷を複数台のサーバに分散させるために存在する。各agentは交換可能で、仮にagent用サーバが1台壊れたら、別のagentに負荷を振り向けるよう設定を書き換えるだけでいい。役割としてはだいたいこんな感じ。 master 各チームのスコア表示、およびベンチマークの起動・停止操作の提供、agentへのベンチマーク実行状況の問合せ、agentへのベンチマーク起動・停止指示、ベンチマーク実行結果の受け取りと保存 agent ベンチマーク処理の起動・停止、ベンチマーク実行状況の提供 (すべてJSON RPC) masterとagentは両方とも n
This is a JavaScript library that helps in progressively enhancing websites. It is relying on pushState, replaceState, onPopState and plain JavaScript to give the user the impression a request is handled on the server, when in fact the request is handled on the client itself. The library is a client side implementation of the Express* API. The goal here is to promote re-use of the routing and temp
Socket.IO のサーバは v0.7 からスタンドアローンでも立てられるようになりましたが、 Express のサーバ上に Socket.IO のサーバを同居させる構成は多いと思います。 しかし Socket.IO は Express が HTTP で確立したセッションとは別のコネクションを確立するため、 例えば、 Socket.IO で接続したユーザが Express で認証したユーザかどうか等が判別できません。 そこで、 Socket.IO で接続を確立時に Express のセッション用の Cookie を取得して、接続を識別できるようにし、 さらに Socket.IO でのやり取りが長くなっても、その間にセッションデータが切れることが無いように、更新する必要が有ります。 Socket.IOv0.7 を用いてこれを実現する方法が、こちらで紹介されていたので、試してみました。 So
Railway is the Node.JS MVC framework based on Express. It allows you to build web applications in a similar manner as in Ruby On Rails.railwayjs.jp 本サイトはrailway.comを日本語に翻訳したもので、実際にrailwayを用いて作成されています。 railwayとは? railwayはExpress上で動作するNode MVCフレームワークです。 Ruby on Railsと同様の方法でWebアプリケーションを構築することができます。 railwayは非常に若いながらも、強力なツールです。 インストール方法 sudo npm install railway -g クイックスタート ジェネレイターとscaffoldを使いrailwayアプリ
The guys were totally low-key, easy to work with, flexible and overall fantastic. We had a lot of issues that were 100% on our end and HugeDomains was always easy to reach, helpful and on top of communication. This is was the most expensive domain purchase I've made to date was really nervous and unsure about working with an unknown company, but they were completely legitimate and though monotone,
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く