OK, so I've had plenty of time to research, test and do things. Here is what I found:
libpd and python
Python is a great server side language, with support for websockets and other communication protocols. It also uses libpd - the pure data library/wrapper, available for many programming languages including python. Downside is that it works best for only pd vanilla objects. While I hear that you can add external support, it is not an easy thing to do. I'm currently following this path to a solution...
WebPD
This is NOT a server side solution, so you do not get the benefit of a community/collaborative experience, where everyone can hear at the same time.
The Javascript library that allows you to load a puredata patch and run it via the Web Audio API. Works ok, but a VERY limited amount of objects are supported! Although I was able to get this patch working well using only standard pd vanilla objects, it was still not enough for me to get this patch working with webpd.
icecast streaming
This works great, EXCEPT, there is a LOT of latency. 6-12 seconds! The best we can reduce it to is 6s in the icecast.xml settings below. The rest can only be reduced in the mp3cast~ pd external by changing the source code and recompiling, however buffering/streaming issues may arise... if anyone wishes to try this - please let me know! :)
There is a pure data object (included in pd-extended) called mp3cast~
install these packages:
pd-extended
alsa sound drivers:
alsa
alsa-tools
libasound2-dev
streaming, and dependencies:
curl
libxml2
libxslt
lame
icecast2 // This will also launch a setup program in your command line - it will ask you to enter three separate passwords - delete the default (make sure you delete ALL THE WAY to the beginning of the line) then enter your password, each time
load alsa dummy driver
Add line to “/etc/modules” (Ubuntu 14.04):
snd-dummy
Enter this into the Ubuntu command line:
sudo modprobe snd-dummy // loads dummy sound card into the kernel
sudo adduser <yourusername> audio // adds you to the audio group
sudo init 6 // reboots ubuntu (any other method of restarting is fine)
configure icecast2
Edit the file at /etc/icecast2/icecast.xml
Edit this to cut down latency by 6s:
0
0
Burst on connect pre-buffers so that you don't have any issues on starting up a stream. This is nice, but adds an extra 6s (when is left at the default - 65535).
Edit this spot with your hostname or ip address and the port that will be typed into the browser (or connected to in your front end code):
111.111.111.111
8000
And you can also change your passwords, displayed location and contact, mount point (it is /stream by default), etc. But the above is just what NEEDS to be done. Then follow the instructions in the mp3cast~ help file.
start it up:
launch icecast2 server:
sudo /etc/init.d/icecast2 start
launch the pd patch:
sudo pd-extended -nogui -noadc -rt -alsa /path/to/patch/pdPatch.pd &
flags:
-nogui required! This sets it to NO GUI, because there is none on a server
-noadc because we're not receiving audio in, so just don't use it
-rt give it realtime priority
-alsa force alsa soundcard - probably not necessary, but good practice
& - allows you to continue using the command line while pd-extended continues to run