socketio-file-upload
socketio-file-upload copied to clipboard
Customize topic name
Hello !
Thank you for this project !
I need to transfer files from a client to an other client. Depending of the topic the final client change. I have already all logic to dispatch the message from the server depending of the topic name.
My question: Are you interested in a PR to allow customizing topic name ?
ex:
socket.emit(`${customTopic}_progress`, {
id: id,
size: file.size,
start: start,
end: end,
content: content,
base64: isBase64
});
I need to do it anyway. But if you want I can share my result in a PR and take any good advice from you before do so.
Sure! For example, call the new option messageNamePrefix
, and have it default to siofu
.
For the unit test, probably just set some arbitrary custom value to the new option, and assert on the server side and client side that the received messages names are consistent.