I tried this solution and it seems to be working for my sails app. The http modules createServer is overwritten and on the second require('http') the overridden ProxyServer is visible. However, when I am trying to run it within docker the second require('http') doesn't seem to be picking the http module from cache.