compatibility #230

alvarolm opened this Issue Oct 15, 2012 · 21 comments


None yet
10 participants

I haven't found yet any about, would be nice :)


mcavage commented Oct 21, 2012

Yeah, I looked at it a long time ago, but frankly nobody was asking for it, so I just never did it. It would be nice, although the masses are pretty clear they'd like zip first ;)


this works


This probably isnt the most proper way to handle this BUT you can do the following:

serv = restify.createServer();

mcavage commented Oct 31, 2012

Since there's clearly interest in this, I'm actually curious if you folks looking for it could give me some input of what you it to act like? Is this purely because you want the restify server on port XXXX to also serve requests on the same port? Or, something else?

for me works just perfect, I wanted the restify server on the same port as


mcavage commented Oct 31, 2012

As in the example from @zacheryph is all you're looking for?

I think this throws people off since its a bit different than express/connect. express extends connect which extends node's HTTPServer (albeit in a little convoluted way) so the express app itself is the http server. though restify is wrapping the server and 'hiding' it from the user.

It might be beneficial to look at changing restify to extend node's HTTPServer as appose to wrapping it, that or making it maybe a little more obvious in the wiki/docs for how to get to the raw server for these purposes (though its not that hard to find looking at the source)

just a few pennies in the jar. i haven't had the opportunity to use restify yet myself :x

mavrick commented Nov 1, 2012

@mcavage correct, if you can support to run on the same port as the restify server (same as express support for then you will make a lot of people happy :D

melkior commented Nov 1, 2012



mcavage commented Nov 1, 2012

Ok, I hacked this some last night - shouldn't be hard to get it "suitable". I'll make sure this is included in restify 2.0.

I should note how i commented is how express 2 works. I'm pretty sure express 3 works the same way as does in which you manually create the http server and give express the http server to bind too.

tamsler commented Nov 10, 2012


tamsler commented Nov 16, 2012

When will you release restify v2.0?


mcavage commented Nov 16, 2012

Realistically given my day job schedule, sometime mid-late december.

On Fri, Nov 16, 2012 at 2:18 PM, Thomas Amsler notifications@github.comwrote:

When will you release restify v2.0?

Reply to this email directly or view it on GitHub


ghost commented Nov 17, 2012

I also consider using restify but I ask myself how to use restify if I have a running node server which serves my static files and want to use this node to run a REST api with restify? Or in other words, is there no way to get restify hook into an existing node rather than opening a dedicated server instance?

tamsler commented Nov 26, 2012

How does the client access "" via restify?

@tamsler this is handled by when it is attached to the http server.

as far as i understand it, the way express 3 works is you give it the http server to 'attach' to, like does, handles adding routes to the http server to respond to.

tamsler commented Dec 1, 2012

@zacheryph You are correct. adds routes for /

@mcavage mcavage pushed a commit that referenced this issue Dec 16, 2012

Mark Cavage #230: first class 631662b

mcavage commented Dec 16, 2012

Ok, this is in #master now - there's an example server in /examples. Anybody want to validate?

mcavage closed this Dec 16, 2012

euskode commented Jan 14, 2013

I can't seem to get it to work. @mcavage what do you mean by "just treat your restify server as if it were a "raw" node server"? I get what you mean by the example, but that is not how I use restify, so I am wondering if that is a requirement in some way. When I attempt to connect to listening on the same port as restify, I get 404s.

This does not work with a non default 'resource'. e.g.

// client
var socket = io.connect('http://localhost:9080', { resource: 'myspecial/' });

// server
 var io = socketio.listen(server, {
            'resource': '/myspecial/', 

Works fine the native http server.

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