The simple answer is no - you have the same problem with any BLE device.
Having TCP/IP networking over BLE isn't part of the standard enough that your computer will have a 'bridge' to connect BLE to your computer's network connection pre-installed.
The sort of thing you're doing would then work - however you'd be better starting off with the ble_http example code as I'm pretty sure what you have there isn't right.
Or if you're running node.js in your PC, you could use the noble library to receive BLE advertising packets, and could then just set your Puck up to change advertising data when the button was pressed - that'd be pretty much the standard way to do it.
... although you would probably want to buy a USB BLE adaptor, as 'noble' wants full control of it when running, and you might still want Windows to be able to access BLE.
eventually Puck.js will support Bonding, which will allow you to use it as a BLE Keyboard with windows - when that happens that'd be by far the easiest way to get notified when something happens!
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The simple answer is no - you have the same problem with any BLE device.
Having TCP/IP networking over BLE isn't part of the standard enough that your computer will have a 'bridge' to connect BLE to your computer's network connection pre-installed.
The simplest way to get one would be to follow the instructions here and set one up on a Raspberry Pi: http://www.espruino.com/Puck.js+Node-RED
The sort of thing you're doing would then work - however you'd be better starting off with the
ble_http
example code as I'm pretty sure what you have there isn't right.Or if you're running node.js in your PC, you could use the
noble
library to receive BLE advertising packets, and could then just set your Puck up to change advertising data when the button was pressed - that'd be pretty much the standard way to do it.... although you would probably want to buy a USB BLE adaptor, as 'noble' wants full control of it when running, and you might still want Windows to be able to access BLE.
eventually Puck.js will support Bonding, which will allow you to use it as a BLE Keyboard with windows - when that happens that'd be by far the easiest way to get notified when something happens!