ov-studio / vital.network Goto Github PK
View Code? Open in Web Editor NEWVital.network ━ Vital.js' Networker (Lightweight yet Reliable)
License: GNU General Public License v3.0
Vital.network ━ Vital.js' Networker (Lightweight yet Reliable)
License: GNU General Public License v3.0
Allow clients to auto-reconnect after a break in connection.
This should include:
ping
, reconnect_attempt
, reconnect
and reconnect_error
(similar to how socket.io implements this)Upon losing and reconnecting the existing client should have the same VID assigned, this would allow to persist the instances safely.
The following utility functions would be great to build a management tool for the socket server:
vNetworkify.fetchSockets()
: Retrieve an array of the socketssocket.fetchNetworks()
: Retrieve an array of the networks for the provided socket instancesocket.fetchRooms()
: Retrieve an array of the rooms for the provided socket instancesocket.fetchClients()
: Retrieve an array of the clients connected to the provided socket instancesocket.fetchClients()
: Retrieve an array of the clients connected to the provided room instanceValidate hostname prior to creating a server.
This is probably an edge case, but might be worthwhile considering:
For some hosted code environments (codesandbox, reply.it, etc), one cannot connect to the environment externally, by specifying a port, i.e. the URL pointing to the environment, will connect using the default/main port of the environment.
At present when doing a vNetworkify.connect()
from a client, the port is a mandatory argument.
It would be great if this argument could be optional. Then instead of ALWAYS building the socket server url as {{protocol}}://{{hostname}}:{{port}}
, it could also allow for {{protocol}}://{{hostname}}
.
Native instances such as socket
and client
should be safe & shouldn't be exposed on functions like socket.onClientConnect
& socket.onClientDisconnect
as such. Clients can explicitly control otherwise which is not great.
Consideration:
CLIENT:
SERVER:
Destroy socket's (room, network...etc) instances similarly as client
manager: https://github.com/ov-studio/vNetworkify/blob/main/src/managers/socket/index.js#L112
How should it be?
https://github.com/ov-studio/vNetworkify/blob/main/src/managers/socket/client.js#L29
Supply a parameter to know since how long the server been running, this could be either tick or date
object itself as such indicated below:
socket.onServerDisconnect(function(startedOn, endedOn, estimatedRunTicks) {
})
Add server side support for rest.fetch()
just like client API; It would be useful to remotely fetch some host's rest API on current server.
Support for invoking & fetching REST APIs directly on client side w/o utilizing external libraries
Events such as cSocket.onClientJoinRoom(room, vid)
& cSocket.onClientLeaveRoom(room, vid)
are essentially needed. Moreover client's room list must be to synced with clients as well.
Possibly there is no need of 3rd party uuid
library since Crypto.randomUUID()
can be used along w/ our own identifier appended to it etc.
Add helper functions to get module's version. Forward this version to server when client tries to connect.
POV: User can then utilize which clients should be able to connect or major version changes will automatically be rejected
sslcert.env
during startup incase of existence.https
connection over http
.wss
over ws
.ws
is used encode all socket messages (tea
encode, perhaps??); Key should be sent to client only once during the initialization of connection as suggested by @Anisa-Nur.Include events to trap connection errors for sockets on both server and client. It would be great if this could include a reason
(similar to socket.io) to allow for different strategies (throw exception, manual reconnection, etc), based on the reason for disconnection.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.