{"action":"created","issue":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/2723","labels_url":"https://api.github.com/repos/syncthing/syncthing/issues/2723/labels{/name}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/2723/comments","events_url":"https://api.github.com/repos/syncthing/syncthing/issues/2723/events","html_url":"https://github.com/syncthing/syncthing/issues/2723","id":128222955,"number":2723,"title":"Too slow session start through relay, and host connected to relay via internet instead local network","user":{"login":"alex73","id":749667,"avatar_url":"https://avatars.githubusercontent.com/u/749667?v=3","gravatar_id":"","url":"https://api.github.com/users/alex73","html_url":"https://github.com/alex73","followers_url":"https://api.github.com/users/alex73/followers","following_url":"https://api.github.com/users/alex73/following{/other_user}","gists_url":"https://api.github.com/users/alex73/gists{/gist_id}","starred_url":"https://api.github.com/users/alex73/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex73/subscriptions","organizations_url":"https://api.github.com/users/alex73/orgs","repos_url":"https://api.github.com/users/alex73/repos","events_url":"https://api.github.com/users/alex73/events{/privacy}","received_events_url":"https://api.github.com/users/alex73/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-01-22T19:09:02Z","updated_at":"2016-01-29T09:12:52Z","closed_at":null,"body":"Hi. I reported issue to the relaysrv project(see https://github.com/syncthing/relaysrv/issues/30), but Audrius wrote it was wrong repository.\r\n\r\nThe problem is: devices connected after long delay through my relay server. Up to 10 minutes sometimes. Connection to relay server is really fast(it displays Relays:1/1 immediately), but session between devices starts after long delay. Audrius recommended to change RelayReconnectIntervalM, but it doesn't change anything.\r\n\r\nAfter both syncthing servers connected to one relay, I'm expecting just some seconds for start session. Also, looks like my hosts connected to relay through internet instead local network.\r\n\r\nMy configuration is: host1 and host2 in the internal network, host3 outside behind NAT, host1 also has public IP\r\n\r\nhost1/relaysrv has address 192.168.1.1 and external IP (67.x.x.x)\r\nhost2/syncthing has address 192.168.1.5 - the same internal network as host1(but routes to worls through 178.x.x.x)\r\nhost3/syncthing has address 10.x.x.x behind NAT(other internal network with external ip=86.x.x.x)\r\n\r\nSo, host1 and host2 can be accessed directly in local network, host3 can access to host1, host2 and host3 can't see each other directly.\r\n\r\nhost1/relaysrv started with -pools=\"\"\r\nhost2 and host3 : adress is dynamic, global discovery enabled, relay enabled\r\nrelay server host host2 defined as \"relay://192.168.1.1:port\"\r\nrelay server host host3 defined as \"relay://67.x.x.x:port\"\r\n\r\nJust after starting, syncthing on host2 and host3 finds relay immediately, but display \"Disconnected\" as device status. Debug of relaysrv displays only \"pong\" packets.\r\n\r\nProbably it will be important: When session started after huge dalay, relaysrv displays source and target very strange. It displays 178.x.x.x but not 192.168.x.x as source address for host2). Target address(host3) displayed as 86.x.x.x(that's good). Additional host that doesn't know about my local relay connects to host2 very fast through public relay server. Shouldn't public relay be disabled if I defined local relay ?\r\n\r\nLogs after both syncthing(on the host2 and host3) was started:\r\n\r\n21:29:19 listener.go:46: Listener accepted connection from 86.x.x.x tls true\r\n21:29:19 listener.go:105: Message protocol.Pong from UUK...\r\n21:29:21 listener.go:46: Listener accepted connection from 192.168.1.5\r\n21:29:21 listener.go:105: Message protocol.JoinRelayRequest from P3F...\r\nsome ...protocol.Pong... messages\r\n21:33:51 listener.go:46: Listener accepted connection from 178.x.x.x tls true\r\n21:33:52 listener.go:105: Message protocol.ConnectRequest from P3F...\r\n21:33:52 session.go:53: New session <a3.../43...>\r\n21:33:52 listener.go:161: Sent invitation from P3F... to UUK...\r\n21:33:52 session.go:121: Session <a3.../43...> serving\r\n21:33:52 listener.go:236: Sending message protocol.SessionInvitation to UUK...\r\n21:33:52 listener.go:187: Closing connection P3F... xdr read: read tcp 178.x.x.x use of closed network connection\r\n21:33:52 listener.go:46: Listener accepted connection from 178.x.x.x tls false\r\n...\r\n\r\nIs it possible that problem is in global discovery ? I.e. host2 connected to relay through internet instead local network ?"},"comment":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/comments/176654892","html_url":"https://github.com/syncthing/syncthing/issues/2723#issuecomment-176654892","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/2723","id":176654892,"user":{"login":"AudriusButkevicius","id":1144861,"avatar_url":"https://avatars.githubusercontent.com/u/1144861?v=3","gravatar_id":"","url":"https://api.github.com/users/AudriusButkevicius","html_url":"https://github.com/AudriusButkevicius","followers_url":"https://api.github.com/users/AudriusButkevicius/followers","following_url":"https://api.github.com/users/AudriusButkevicius/following{/other_user}","gists_url":"https://api.github.com/users/AudriusButkevicius/gists{/gist_id}","starred_url":"https://api.github.com/users/AudriusButkevicius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AudriusButkevicius/subscriptions","organizations_url":"https://api.github.com/users/AudriusButkevicius/orgs","repos_url":"https://api.github.com/users/AudriusButkevicius/repos","events_url":"https://api.github.com/users/AudriusButkevicius/events{/privacy}","received_events_url":"https://api.github.com/users/AudriusButkevicius/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T09:12:52Z","updated_at":"2016-01-29T09:12:52Z","body":"Relays and discovery are different things, relays don't provide discovery and vica versa. You need both for syncthing to function.\r\n\r\nAt the same time, they were not designed to run on the same local network as one of the syncthing devices (not even talking about on the same machine) because the IPs a discovery/relay would see would either be 127.0.0.1 or some 192.168.0.5 which makes no sense when connecting from the outside of the LAN."}}