Created
April 7, 2023 13:56
-
-
Save Risto-Stevcev/95affc900e5ee81814901294c54ffad2 to your computer and use it in GitHub Desktop.
Websockets using unix domain sockets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ws = require('ws'); | |
var client = new ws("ws+unix:///tmp/server.sock") | |
client.send('hello') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var WebSocketServer = require('ws').Server; | |
var server = http.createServer() | |
var wss = new WebSocketServer({ server : server}); | |
server.listen('/tmp/server.sock') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/23930293/websockets-listening-on-unix-domain-socket