Zeroconf (Bonjour/Avahi) support for HTTP

Want something added? Ask for it here.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by sander »

fkmtc wrote: Hi all,

I was wondering the status of that "Bonjour" support SABnzbd+... I would love to have that feature in SABnzbd+ !!

I'm the developer of SABMobile and would make very good use of that "auto discovering" of sab :)

Thanks,
Jérôme
AFAIK the status is the same as two years ago:
there is a patch working for Linux (tested by me and a few others). I don't know if it works on Windows; I don't know how to run SABnzbd from source on Windows.
I have the feeling the SAB devs are not very interested in this functionality
I must say I don't know how widely spread bonjour / zeroconf functionality is in the Windows world. I think you have to install "bonjour for Windows" from Apple to *see* bonjour resources.

IMHO bonjour functionality in SAB could be a solution for a lot of questions in this forums: it would take away the problems with IP and port, and it would make clear if SAB is running with more than one instance.

So: do you run Linux? Or Mac? Or Windows with SAB-from-source-code? If so, I can patch 0.6.1 with the bonjour-patch, so that you can test it.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
fkmtc
Full Member
Full Member
Posts: 209
Joined: September 19th, 2010, 4:49 am

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by fkmtc »

Hi,

Thanks for your answer.

In fact, I run SABnzbd+ on my NAS, so QNAP or Synology, depends on which one is launched :) I just use MacOS version and Windows version for testing my application SABMobile.

I guess I'll wait for it to be in an official release...

Thanks,
Jérôme
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by shypike »

sander wrote: I have the feeling the SAB devs are not very interested in this functionality
We are, but there so much to be done.
Didn't you have a working solution that we could implement?
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by sander »

fkmtc wrote: Hi,

Thanks for your answer.

In fact, I run SABnzbd+ on my NAS, so QNAP or Synology, depends on which one is launched :) I just use MacOS version and Windows version for testing my application SABMobile.

I guess I'll wait for it to be in an official release...

Thanks,
Jérôme
Your NAS probably runs Linux. So I guess that means you could run the patched SABnzbd. First check: can you find sabnzbd.py on your NAS?

As you're a programmer, I think you can handle it. ;-)
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
fkmtc
Full Member
Full Member
Posts: 209
Joined: September 19th, 2010, 4:49 am

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by fkmtc »

sander wrote:
fkmtc wrote: Hi,

Thanks for your answer.

In fact, I run SABnzbd+ on my NAS, so QNAP or Synology, depends on which one is launched :) I just use MacOS version and Windows version for testing my application SABMobile.

I guess I'll wait for it to be in an official release...

Thanks,
Jérôme
Your NAS probably runs Linux. So I guess that means you could run the patched SABnzbd. First check: can you find sabnzbd.py on your NAS?

As you're a programmer, I think you can handle it. ;-)
I can handle it, but I don't want to. My aim is to add "Auto discovery" to my application, so that configuration is very simple. This means that the end user will just download my app and try to find its sabnzbd+ server. In that case, this won't be my "patched installation on my private NAS", but the end user installation...

I could use the patch to try out the feature, but can't release that because nobody will be able to use it (well, those with the patch... but if they know how to patch it, they know how to enter the IP address ;-))

Cheers,
Jérôme
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by sander »

fkmtc wrote:

I can handle it, but I don't want to. My aim is to add "Auto discovery" to my application, so that configuration is very simple. This means that the end user will just download my app and try to find its sabnzbd+ server. In that case, this won't be my "patched installation on my private NAS", but the end user installation...

I could use the patch to try out the feature, but can't release that because nobody will be able to use it (well, those with the patch... but if they know how to patch it, they know how to enter the IP address ;-))

Cheers,
Jérôme
I understand your point. At the same time, that's in a nutshell the problem with this patch: if even people like you don't start using it, I would it's a signal bonjour is too little value. *If* you would try it, we could get experience, and make it easier to get it into mainstream SAB :-)
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
fkmtc
Full Member
Full Member
Posts: 209
Joined: September 19th, 2010, 4:49 am

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by fkmtc »

OK, fine :)

Give me the piece of code !

Could you also tell me for which version of SABnzbd+ it would work best ? I currently have 0.5.3 or something, because QNAP guys are a little lazy to make clean packages...

Thanks,
Jérôme
fkmtc
Full Member
Full Member
Posts: 209
Joined: September 19th, 2010, 4:49 am

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by fkmtc »

Hi,

I tried, but it seems that I cannot import pybonjour... might be missing something (I copied it to sabnzbd/utils/). Is there any way to check what the problem might be ?

Thanks,
Jérôme
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by sander »

fkmtc wrote: Hi,

I tried, but it seems that I cannot import pybonjour... might be missing something (I copied it to sabnzbd/utils/). Is there any way to check what the problem might be ?

Thanks,
Jérôme
Ouch, I now read a quote in the first of this trhead: "pybonjour requires the Bonjour compatibility layer (libavahi-compat-libdnssd1) to be installed.". That could be the problem on your NAS ... :-(
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by sander »

FYI:

the bonjour patch works (unmodified) with SABnzbd 0.6.1.  :)

On Ubuntu, you need:
sudo apt-get install libavahi-compat-libdnssd1
pybonjour.py (from http://code.google.com/p/pybonjour/) copied into sabnzbd/utils/

And, you could use "avahi-discover" on Ubuntu to view the bonjour resources
Last edited by sander on May 18th, 2011, 12:49 pm, edited 1 time in total.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
fkmtc
Full Member
Full Member
Posts: 209
Joined: September 19th, 2010, 4:49 am

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by fkmtc »

Hi,

I've installed avahi, but not the ddns stuff. Is it mandatory ?

I guess the installation of SABnzbd+ might be a lot more complicated if that is needed...

Thanks,
Jérôme
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by sander »

fkmtc wrote: Hi,

I've installed avahi, but not the ddns stuff. Is it mandatory ?
I don't know. Can your run the patched SABnzbd without the ddns stuff?
fkmtc wrote:
I guess the installation of SABnzbd+ might be a lot more complicated if that is needed...
I realize patching SABnzbd with bonjour would introduce more OS/platform dependency... :-(  
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by shypike »

I have Bonjour running now for OSX.
Later I will test with Linux and Windows.
The PyBonjour code claims it supports the Windows and Linux solutions too.
We'll see.

Slight disappointment in that Bonjour will not publish "localhost".
So it won't be useful in the default setup of SABnzbd.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by sander »

shypike wrote: I have Bonjour running now for OSX.
Later I will test with Linux and Windows.
The PyBonjour code claims it supports the Windows and Linux solutions too.
We'll see.

Slight disappointment in that Bonjour will not publish "localhost".
So it won't be useful in the default setup of SABnzbd.
I found this quote, maybe helpful:

Code: Select all

The definition for kDNSServiceInterfaceIndexLocalOnly says

* If the client passes kDNSServiceInterfaceIndexLocalOnly when registering
 * a service, then that service will be found *only* by other local clients
 * on the same machine that are browsing using
kDNSServiceInterfaceIndexLocalOnly
 * or kDNSServiceInterfaceIndexAny.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Zeroconf (Bonjour/Avahi) support for HTTP

Post by sander »

I just discovered a bug in my code: when HTTPS is enabled in SAB, the service advertised via bonjour is like 'http://:9090/sabnzbd'. Which is an incorrect mix of 'http://:8080/sabnzbd' and 'httpS://:9090/sabnzbd'

The problem is in this part of the code:

Code: Select all

	            regtype = '_http._tcp',
	            port = int(cherryport),
I guess I'll have to look into variables enable_https and https_port, and change the regtype ...

@shypike: if HTTPS is enabled, is there still a way to find out on which plain HTTP is running? It's not in cherryport, as that contains the HTTPS port ...
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply