Table.json watch fails on windows #258

Closed
No9 opened this Issue Jun 2, 2012 · 4 comments

Comments

Projects
None yet
3 participants
Contributor

No9 commented Jun 2, 2012

When using the file watch routing table approach on windows

var httpProxy = require('http-proxy');
var options   = { router: 'table.json' };

where table.json is defined as a file with the following contents:

{
   "router":
   {
      "domain1.com": "127.0.0.1:8080",
      "domain2.com": "127.0.0.1:8001"
   }
}

it fails with the following error

httpProxy.createServer(options).listen(80);
Error: use fs.watch api instead
    at Object.watchFile (fs.js:746:11)
    at new <anonymous> (C:\GitHub\coolamber\node_modules\h
ttp-proxy\lib\node-http-proxy\proxy-table.js:62:8)
    at new <anonymous> (C:\GitHub\coolamber\node_modules\h
ttp-proxy\lib\node-http-proxy\routing-proxy.js:28:23)
Contributor

coderarity commented Jun 20, 2012

Interesting, I thought the point of using fs.watchFile was that it was more cross-platform than fs.watch. I think it might be better if we used fs.watch anyways, it's a lot better than stat polling.

Owner

indexzero commented Mar 9, 2013

This is ancient. The underlying windows compat issues in node.js core are likely resolved.

indexzero closed this Mar 9, 2013

Contributor

No9 commented Mar 9, 2013

If you would like me to check i can. Fs.watch is still marked unstable in 0.8.22 http://nodejs.org/docs/latest/api/fs.html. So my hunch is this is probably still an issue.

Contributor

No9 commented Mar 9, 2013

@indexzero tested and ran with no problems
This issue is resolved.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment