How can a client in a LAN set a webhook?
up vote
-1
down vote
favorite
I have a question on webhook. I'm making some IoT device (an Arduino, for example) which controls my TV. The device is connecting to a router and owns a local IP address. In addition, I have a cloud server setup. To control the TV using my phone, all I can think of is to send a HTTP request to the server from the phone, saying "hey I want to turn on the TV." The server takes notes, and the next time (hopefully not very late after) the IoT device query the server for command, the server tells it that the mobile user wants to turn on the TV.
In order to implement this, the IoT device has to send HTTP request to the server very frequently, therefore consuming quite some battery energy. Recently I heard the idea of "Webhook", saying that instead of querying the server frequently, one can provide a URL to the server so that in case there is any command from the user (in this case, me on the mobile phone), the server can make an HTTP request to the client (in this case, the controlling device).
However, the problem for me is my controlling device only has a local IP, and without manually doing the port forwarding on the router, I don't know how it can own a URL accessable by another user not living in the same LAN. Is this achievable?
I also knew the "websocket" protocol but it seems to me that the server needs to maintain a TCP connection with every client. With little knowledge to it, I can tell whether it's more suitable for the task I described. (Potentially, there will be tens of thousands of users controlling their own TVs through one server on the cloud.)
Did I misunderstand the usage of webhook entirely? If not, how do we solve the local IP problem?
Thanks very much!
http websocket iot webhooks
add a comment |
up vote
-1
down vote
favorite
I have a question on webhook. I'm making some IoT device (an Arduino, for example) which controls my TV. The device is connecting to a router and owns a local IP address. In addition, I have a cloud server setup. To control the TV using my phone, all I can think of is to send a HTTP request to the server from the phone, saying "hey I want to turn on the TV." The server takes notes, and the next time (hopefully not very late after) the IoT device query the server for command, the server tells it that the mobile user wants to turn on the TV.
In order to implement this, the IoT device has to send HTTP request to the server very frequently, therefore consuming quite some battery energy. Recently I heard the idea of "Webhook", saying that instead of querying the server frequently, one can provide a URL to the server so that in case there is any command from the user (in this case, me on the mobile phone), the server can make an HTTP request to the client (in this case, the controlling device).
However, the problem for me is my controlling device only has a local IP, and without manually doing the port forwarding on the router, I don't know how it can own a URL accessable by another user not living in the same LAN. Is this achievable?
I also knew the "websocket" protocol but it seems to me that the server needs to maintain a TCP connection with every client. With little knowledge to it, I can tell whether it's more suitable for the task I described. (Potentially, there will be tens of thousands of users controlling their own TVs through one server on the cloud.)
Did I misunderstand the usage of webhook entirely? If not, how do we solve the local IP problem?
Thanks very much!
http websocket iot webhooks
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have a question on webhook. I'm making some IoT device (an Arduino, for example) which controls my TV. The device is connecting to a router and owns a local IP address. In addition, I have a cloud server setup. To control the TV using my phone, all I can think of is to send a HTTP request to the server from the phone, saying "hey I want to turn on the TV." The server takes notes, and the next time (hopefully not very late after) the IoT device query the server for command, the server tells it that the mobile user wants to turn on the TV.
In order to implement this, the IoT device has to send HTTP request to the server very frequently, therefore consuming quite some battery energy. Recently I heard the idea of "Webhook", saying that instead of querying the server frequently, one can provide a URL to the server so that in case there is any command from the user (in this case, me on the mobile phone), the server can make an HTTP request to the client (in this case, the controlling device).
However, the problem for me is my controlling device only has a local IP, and without manually doing the port forwarding on the router, I don't know how it can own a URL accessable by another user not living in the same LAN. Is this achievable?
I also knew the "websocket" protocol but it seems to me that the server needs to maintain a TCP connection with every client. With little knowledge to it, I can tell whether it's more suitable for the task I described. (Potentially, there will be tens of thousands of users controlling their own TVs through one server on the cloud.)
Did I misunderstand the usage of webhook entirely? If not, how do we solve the local IP problem?
Thanks very much!
http websocket iot webhooks
I have a question on webhook. I'm making some IoT device (an Arduino, for example) which controls my TV. The device is connecting to a router and owns a local IP address. In addition, I have a cloud server setup. To control the TV using my phone, all I can think of is to send a HTTP request to the server from the phone, saying "hey I want to turn on the TV." The server takes notes, and the next time (hopefully not very late after) the IoT device query the server for command, the server tells it that the mobile user wants to turn on the TV.
In order to implement this, the IoT device has to send HTTP request to the server very frequently, therefore consuming quite some battery energy. Recently I heard the idea of "Webhook", saying that instead of querying the server frequently, one can provide a URL to the server so that in case there is any command from the user (in this case, me on the mobile phone), the server can make an HTTP request to the client (in this case, the controlling device).
However, the problem for me is my controlling device only has a local IP, and without manually doing the port forwarding on the router, I don't know how it can own a URL accessable by another user not living in the same LAN. Is this achievable?
I also knew the "websocket" protocol but it seems to me that the server needs to maintain a TCP connection with every client. With little knowledge to it, I can tell whether it's more suitable for the task I described. (Potentially, there will be tens of thousands of users controlling their own TVs through one server on the cloud.)
Did I misunderstand the usage of webhook entirely? If not, how do we solve the local IP problem?
Thanks very much!
http websocket iot webhooks
http websocket iot webhooks
asked Nov 21 at 9:27
Zheng Liu
1568
1568
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408883%2fhow-can-a-client-in-a-lan-set-a-webhook%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown