[fix] Fixes #1 change avahi service protocol to _teleport:_tcp
This commit is contained in:
@@ -184,8 +184,8 @@ int teleport_browser_run_avahi_service(TeleportPeer *peers) {
|
||||
}
|
||||
|
||||
/* create some browsers on the client object here, if you wish */
|
||||
//if (!(avahi_service_browser_new(client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_http._tcp", NULL, 0, browse_callback, client))) {
|
||||
if (!(avahi_service_browser_new(client, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, "_http._tcp", NULL, 0, browse_callback, client))) {
|
||||
//if (!(avahi_service_browser_new(client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_teleport._tcp", NULL, 0, browse_callback, client))) {
|
||||
if (!(avahi_service_browser_new(client, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, "_teleport._tcp", NULL, 0, browse_callback, client))) {
|
||||
/* so something bad */
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -102,12 +102,12 @@ static void create_services(AvahiClient *c) {
|
||||
* same name should be put in the same entry group. */
|
||||
|
||||
/* Add the service for Teleport */
|
||||
if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_http._tcp", NULL, NULL, 3000, "test=blah", r, NULL)) < 0) {
|
||||
if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_teleport._tcp", NULL, NULL, 3000, "test=blah", r, NULL)) < 0) {
|
||||
|
||||
if (ret == AVAHI_ERR_COLLISION)
|
||||
goto collision;
|
||||
|
||||
fprintf(stderr, "Failed to add _http._tcp service: %s\n", avahi_strerror(ret));
|
||||
fprintf(stderr, "Failed to add _teleport._tcp service: %s\n", avahi_strerror(ret));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user