[fix] Fixes #1 change avahi service protocol to _teleport:_tcp

This commit is contained in:
Julian Sparber
2017-10-15 19:19:55 +02:00
parent c72b6bb7ad
commit 6995b34b69
2 changed files with 4 additions and 4 deletions

View File

@@ -184,8 +184,8 @@ int teleport_browser_run_avahi_service(TeleportPeer *peers) {
} }
/* create some browsers on the client object here, if you wish */ /* 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_UNSPEC, "_teleport._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_INET, "_teleport._tcp", NULL, 0, browse_callback, client))) {
/* so something bad */ /* so something bad */
return 1; return 1;
} }

View File

@@ -102,12 +102,12 @@ static void create_services(AvahiClient *c) {
* same name should be put in the same entry group. */ * same name should be put in the same entry group. */
/* Add the service for Teleport */ /* 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) if (ret == AVAHI_ERR_COLLISION)
goto 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; goto fail;
} }