Search code examples
node.jsexpressconnectionwifi

How to connect a user to wifi with nodejs


I'm trying to connect a user to wifi using nodejs.

I need something like this

app.get('/', (req, res) => {
    res.send('WIFI:T:WPA;S:myssid;P:mypassword;H:;')
})
app.listen(port, () => {
    console.log(`Example app listening on port ${port}`)
})

For example when I connect to this server with my phone, the server will connect me to that wifi.

I already tryed to use node-wifi but it connects the machine where the server is running, not the client machine.

Thanks in advance


Solution

  • I found that the server cannot ask to connect a smartphone to a network. It is a protected function at the operating system level. Therefore this function cannot be performed.