Comments (2)
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:
- 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
- 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>
- 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.
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)
- suggest for some conditions. HOT 1
- Ping - pthread_mutex_lock called on a destroyed mutex HOT 12
- Connection UID HOT 6
- Error building/compiling on mac silicon. HOT 2
- send_all function return value error HOT 1
- Problems with browsers connections HOT 1
- How can I create a list of connected clients using the wsServer library? (question) HOT 3
- Close Event Not Always Firing on Server HOT 4
- runtime error for left shifts with fsanitize=address,undefined in sha1.c HOT 3
- ws_getaddress() do not work in onmessage() on localhost HOT 2
- wsserver via ssl in linux environment HOT 1
- Optional forked server application model HOT 2
- <feature> Why not support IPv6 HOT 2
- Only works on a loopback adapter HOT 7
- Why would I want to use civetweb for WebSockets, if this exists? HOT 5
- License Change Consent - wsServer Project HOT 11
- mutiple sockets not working. HOT 16
- Problem with recent change to the calling sequence for the function 'ws_socket() HOT 4
- Server closes the socket after a time. How do I ensure it stays open? HOT 6
- Adding native wss (SSL) support [feature] HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wsserver.