Permalink
Browse files

move faye-redis config out for config.js

  • Loading branch information...
1 parent 1401b17 commit 6d399931b72dc5c06e384e0bd99ce33a6b935d05 @evantahler evantahler committed Mar 11, 2013
Showing with 18 additions and 10 deletions.
  1. +1 −9 config.js
  2. +3 −0 examples/clients/web/webSockets.html
  3. +14 −1 initializers/faye.js
View
@@ -93,14 +93,6 @@ configData.faye = {
mount: "/faye",
timeout: 45,
ping: null,
- engine: {
- type: require('faye-redis'),
- host: configData.redis.host,
- port: configData.redis.port,
- password: configData.redis.password,
- database: configData.redis.DB,
- namespace: "faye:",
- }
};
///////////////////////////////////////
@@ -175,7 +167,7 @@ configData.tcpServer = {
configData.webSockets = {
// You must have the web server enabled as well
- enable: false,
+ enable: true,
};
//////////////////////////////////
@@ -1,6 +1,9 @@
<script src="/faye/client.js"></script>
<script src="/public/javascript/actionHeroWebSocket.js"></script>
+<h1>Websocket Example</h1>
+Open the Console.
+
<script>
var A = new actionHeroWebSocket;
View
@@ -9,7 +9,20 @@ var faye = function(api, next){
// api.faye.subscribeHandlers = [];
api.faye._start = function(api, next){
- api.faye.server = new fayePackage.NodeAdapter(api.configData.faye);
+
+ var options = api.configData.faye;
+ if(api.redis.fake != true){
+ options.engine = {
+ type: require('faye-redis'),
+ host: api.configData.redis.host,
+ port: api.configData.redis.port,
+ password: api.configData.redis.password,
+ database: api.configData.redis.DB,
+ namespace: "faye:",
+ }
+ }
+
+ api.faye.server = new fayePackage.NodeAdapter(options);
api.faye.server.bind('handshake', function(clientId){
for(var i in api.faye.connectHandlers){

0 comments on commit 6d39993

Please sign in to comment.