diff --git a/nodejs.admin.inc b/nodejs.admin.inc
index 9585f6e..0a2a0d7 100644
--- a/nodejs.admin.inc
+++ b/nodejs.admin.inc
@@ -41,12 +41,16 @@ function nodejs_settings() {
                     array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>'));
   $form['server']['nodejs_pages'] = array(
     '#type' => 'textarea',
-    '#title' => t('Pages on which to enable nodejs'),
+    '#title' => t('Pages on which to enable or disable nodejs'),
     '#default_value' => variable_get('nodejs_pages', '*'),
     '#required' => TRUE,
     '#description' => $description,
   );
-
+  $form['server']['nodejs_disabled_pages'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Listed pages will be disabled pages.'),
+    '#default_value' => variable_get('nodejs_disabled_pages', 0),
+  );
   return system_settings_form($form);
 }
 
diff --git a/nodejs.module b/nodejs.module
index 830a190..a319955 100644
--- a/nodejs.module
+++ b/nodejs.module
@@ -238,20 +238,39 @@ function nodejs_send_role_message($role_name, $subject, $body) {
  */
 function nodejs_init() {
   drupal_register_shutdown_function(array('Nodejs', 'sendMessages'));
-  if (nodejs_add_js_to_page_check()) {
-    $_SESSION['nodejs_config'] = $nodejs_config = nodejs_get_config();
-    if (isset($nodejs_config['serviceKey'])) {
-      unset($nodejs_config['serviceKey']);
-    }
-    $socket_io_config = nodejs_get_socketio_js_config($nodejs_config);
-    drupal_add_js($socket_io_config['path'], array('type' => $socket_io_config['type']));
-    drupal_add_js(drupal_get_path('module', 'nodejs') . '/nodejs.js', array('type' => 'file'));
-    drupal_add_js(array('nodejs' => $nodejs_config), array('type' => 'setting'));
-    foreach (nodejs_get_js_handlers() as $handler_file) {
-      drupal_add_js($handler_file, array('type' => 'file'));
-    }
+  if(variable_get('nodejs_disabled_pages', '0'))
+  {
+    if (nodejs_add_js_to_page_check_disabled()) {
+        $_SESSION['nodejs_config'] = $nodejs_config = nodejs_get_config();
+        if (isset($nodejs_config['serviceKey'])) {
+          unset($nodejs_config['serviceKey']);
+        }
+        $socket_io_config = nodejs_get_socketio_js_config($nodejs_config);
+        drupal_add_js($socket_io_config['path'], array('type' => $socket_io_config['type']));
+        drupal_add_js(drupal_get_path('module', 'nodejs') . '/nodejs.js', array('type' => 'file'));
+        drupal_add_js(array('nodejs' => $nodejs_config), array('type' => 'setting'));
+        foreach (nodejs_get_js_handlers() as $handler_file) {
+          drupal_add_js($handler_file, array('type' => 'file'));
+        }
+      }//endif
+  }
+  else
+  {
+    if (nodejs_add_js_to_page_check()) {
+     $_SESSION['nodejs_config'] = $nodejs_config = nodejs_get_config();
+        if (isset($nodejs_config['serviceKey'])) {
+          unset($nodejs_config['serviceKey']);
+        }
+        $socket_io_config = nodejs_get_socketio_js_config($nodejs_config);
+        drupal_add_js($socket_io_config['path'], array('type' => $socket_io_config['type']));
+        drupal_add_js(drupal_get_path('module', 'nodejs') . '/nodejs.js', array('type' => 'file'));
+        drupal_add_js(array('nodejs' => $nodejs_config), array('type' => 'setting'));
+        foreach (nodejs_get_js_handlers() as $handler_file) {
+          drupal_add_js($handler_file, array('type' => 'file'));
+        }
+     }
   }
-}
+ }
 
 /**
  * Check if we should add the node.js js to the page.
@@ -271,7 +290,25 @@ function nodejs_add_js_to_page_check() {
   }
   return $valid_page && $valid_user;
 }
+/**
+ * Check if we should add the node.js js to the page.
+ *
+ * We check the url, and whether or not the admin has closed down access to
+ * auth users only.
+ */
+function nodejs_add_js_to_page_check_disabled() {
+  global $user;
+
+  $valid_page = drupal_match_path(drupal_get_path_alias(), variable_get('nodejs_pages', '*'));
 
+  if (variable_get('nodejs_authenticated_users_only', FALSE)) {
+    $valid_user = $user->uid > 0;
+  }
+  else {
+    $valid_user = TRUE;
+  }
+  return !$valid_page && $valid_user;
+}
 /**
  * Return the path to the socket.io client js.
  */
