Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom server #737

Closed
buschtoens opened this issue Aug 11, 2013 · 4 comments
Closed

Custom server #737

buschtoens opened this issue Aug 11, 2013 · 4 comments

Comments

@buschtoens
Copy link

Is it currently possible, to pass sails a custom server? I need this functionality for several reasons (Cluster, SPDY, Proxy, etc.). I thougt about something similiar to this.

var http = require("http")
  , server = http.createServer().listen(80);
require("sails").lift({ server: server });

I'd also be happy with doing it in config/local.js. In fact, I'd prefer this way. :)

btw, I couldn't find any documentation on the options used for require("sails").lift(opts);.

@campbellanderson
Copy link
Contributor

No docs for it but check out

sails.config.express.serverOptions

its used in the sails/lib/express/index.js

var createServer = usingSSL ? require('https').createServer : require('http').createServer;

        // Use serverOptions if they were specified
        // Manually create http server using Express app instance
        if (sails.config.express.serverOptions) {
            sails.express.server = createServer(sails.config.express.serverOptions, sails.express.app);
        }
        else sails.express.server = createServer(sails.express.app);

Im pretty sure you could hook things together in a config file (such an awesome concept)

@buschtoens
Copy link
Author

Yeah, already seen that. This only allows for further configuration of the standard http and https modules.

That's why I submitted #739, which enables you to supply your own server (see the PR description).

@sgress454
Copy link
Member

We'd be willing to accept a pull request to core HTTP hook to add speedy support, if it didn't break anything...

@mikermcneil
Copy link
Member

@silvinci I'm down to see SPDY in the default http hook impl. as well. If you have time to rebase your pull request for v0.10, I'll merge it in a heartbeat. Same thing applies for you, the person reading this who really wants SPDY support :)

Moving to feature requests milestone, and closing in favor of reopening @silvinci's PR

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

Successfully merging a pull request may close this issue.

4 participants