An electronic device comprising: an electronic device application to communicate with a companion device; and a WebSocket server to connect the electronic device application with a companion device application of the companion device using a Websocket protocol, wherein the WebSocket server includes a first endpoint and a second endpoint, wherein the first endpoint is for connecting the WebSocket server with the electronic device application of the electronic device, wherein the second endpoint is for connecting the WebSocket server with the companion device application of the companion device, wherein the WebSocket server receives a first request from the electronic device application of the electronic device, wherein the first request includes first uniform resource information including resource name information of "/hbbtv/" and first application identification information for identifying the electronic device application and a connection between the first endpoint and a first app-endpoint of the electronic device application is generated, wherein the first app-endpoint includes the first application identification information, wherein the WebSocket server receives a second request from the companion device application of the companion device, wherein the second request includes second uniform resource information including the resource name information of "/hbbtv/" and second application identification information for identifying the companion device application and a connection between the second endpoint and a second app-endpoint of the companion device application is generated, wherein the second app-endpoint includes the second application identification information, wherein the WebSocket server connects the electronic device application with the companion device application based on the WebSocket protocol when the first app-endpoint and the second app-endpoint are the same, wherein the first uniform resource information and the second uniform resource information are configured without including Internet Protocol, IP, address information, respectively. an electronic device application to communicate with a companion device; and a WebSocket server to connect the electronic device application with a companion device application of the companion device using a Websocket protocol, wherein the WebSocket server includes a first endpoint and a second endpoint, wherein the first endpoint is for connecting the WebSocket server with the electronic device application of the electronic device, wherein the second endpoint is for connecting the WebSocket server with the companion device application of the companion device, wherein the WebSocket server receives a first request from the electronic device application of the electronic device, wherein the first request includes first uniform resource information including resource name information of "/hbbtv/" and first application identification information for identifying the electronic device application and a connection between the first endpoint and a first app-endpoint of the electronic device application is generated, wherein the first app-endpoint includes the first application identification information, wherein the WebSocket server receives a second request from the companion device application of the companion device, wherein the second request includes second uniform resource information including the resource name information of "/hbbtv/" and second application identification information for identifying the companion device application and a connection between the second endpoint and a second app-endpoint of the companion device application is generated, wherein the second app-endpoint includes the second application identification information, wherein the WebSocket server connects the electronic device application with the companion device application based on the WebSocket protocol when the first app-endpoint and the second app-endpoint are the same, wherein the first uniform resource information and the second uniform resource information are configured without including Internet Protocol, IP, address information, respectively.