To clarify, your server is running node. P5js does not have any server features. You can use it in the backend for sure, but it is not doing the serving part.
Can you provide more details of what you want to do? Do you want to send a single notification? Multiple notifications? Do you want to have an open connection (you mention using sockets). What type of data are you transferring between your P3 java sketch and your server app? Images? One? or a stream, like a video? Are you doing this in your local computer but then you are planing to migrate it to a server later on?
Kf