Accept `port` as `number`
See original GitHub issueIs your feature request related to a problem? Please describe.
I believe defining port
on io
client library seems a better suit if it’s type was a number. Probably most people using socket.io
on frontend and backend use a common variable for port, e.g. export const SERVER_PORT = 3000
in my case. And with current implementation and TypeScript definitions I am not allowed to pass SERVER_PORT
directly to io
and need to do a manual .toString()
on it. (or keep my server port in two places)
Describe the solution you’d like
I think it’s best for socket-io.client
’s exported property io
to accept port
as both number
and string
and convert number to string underneath if necessary.
Describe alternatives you’ve considered
When developers think of port
, they think of number
s. I even believe a breaking change wouldn’t be bad at all
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
I am new to open source and I want to give my contribution ❤. Is someone else working on it ??
Closed by https://github.com/socketio/engine.io-client/commit/8f68f77825af069fe2c612a3200a025d4130ac0a, which is included in
socket.io-client@4.4.0
.