Giter Club home page Giter Club logo

Comments (2)

Theldus avatar Theldus commented on August 18, 2024

Hello @onos9,
Thanks for the compliments =),

About your issue... I'm not very familiar with Node.js and the like so I'm not sure if I understand your question properly.

wsServer does not serve files and is not an HTTP server... so do you want to run wsServer alongside with an HTTP server? if so, just run the two servers normally on different ports, wsServer doesn't need to communicate with the HTTP server or vice versa.

Now, if you want to run both on the same port, you can make a proxy to the websocket server, on Apache it would be something as explained in WebSockets and Apache proxy : how to configure mod_proxy_wstunnel?

But in summary:

  1. Activate mod_proxy.so and mod_proxy_wstunnel.so modules: in your Apache configuration file, uncomment the lines:
LoadModule proxy_module /path/to/lib
LoadModule proxy_wstunnel_module /path/to/lib
  1. In your VirtualHost, add the following lines:
<VirtualHost *:80>
    # Your configs

    # WebSocket tunnel
    RewriteEngine On
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteRule /(.*) ws://localhost:8080/$1 [P,L]
</VirtualHost>
  1. Start/Restart your Apache server.

This way, you will still have wsServer running on port 8080, but Apache will receive all connections on port 80 and those related to WebSocket, will be forwarded to wsServer on 8080 =).

I'm quite sure there is something similar for other servers like Nginx and so on.

from wsserver.

Theldus avatar Theldus commented on August 18, 2024

It's been almost 8 months and I haven't received any reply.

Sorry, but I'm going to close this issue. Feel free to reopen it again with more information or create a new issue.

from wsserver.

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.