Code Monkey home page Code Monkey logo

Comments (2)

theturtle32 avatar theturtle32 commented on July 21, 2024

Ah interesting. Your question caused me to look at the the API I created
for mounting a server again - websocketServer.mount(config) - and I
realized that the design of the API doesn't lend itself well to being able
to mount the websocket instance to multiple http servers. I hadn't really
considered that people might want to do that when I designed it, but it's
certainly a legitimate use case that really ought to be accommodated.

I'll think more on this and how it can be supported without breaking
existing API compatibility.

Brian

On Tue, Jan 8, 2013 at 12:25 AM, James Jenner [email protected]:

Hi,

This is only a minor issue and in all honesty can be fixed either via doco
or not at all.

Just that I tried recently to implement ssl and presumed that there would
be an option for httpsServer, as there is currently an option for
httpServer. Turns out there isn't and must use httpServer.

If you do not specify httpServer then WebSocketServer throws the exception
"You must specify an httpServer on which to mount the WebSocket server."

It just threw me for a little bit until I figured out that I just set
httpServer to the https server that I created.

As I said, it's not a biggie, just a tad confusing is all.

I'm actually curious if it would make sense to be able to specify both a
httpServer and httpsServer for the same websocket, would that make sense?
Right now I'm creating two instances and setting one to the http server and
one to the https server.

Cheers,

James.


Reply to this email directly or view it on GitHubhttps://github.com//issues/75.

Brian McKelvey
C.E.O & Co-Founder
Worlize Inc.
www.worlize.com

from websocket-node.

theturtle32 avatar theturtle32 commented on July 21, 2024

Just pushed a commit that allows you to optionally pass an array of http/https server instances as the value of the httpServer property. There can be as many instances as you like, and they can be a mixture of http or https servers.

from websocket-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.