fixed leading slash in path and added support for https
added setImmediate/clearImmediate