How can a Chrome Extension find a different device (e.g. smartohone) in the local network? - networking

I want to implement a Chrome extension, NOT a Chrome app (because Google stopped the support of chrome apps). This extension should be able to make a connection to a "unknown" device (in my case the smartphone) in the local network to exchange some data (just Strings). It works fine if I fill in the Ip address of the smartphone manually in the extension. But the problem is that in the local network the ip addresses can change. I want to make a reconnection (auto connection) between both.
By the way the extension knows the port which also uses the smartphone. But the ip address could be different.
My idea is that the extension sends a broadcast msg but i think this is not possible.
The best would be to ping all addresses form 192.168.1.0 to .255 but i think with a TCP request this will take a while and the extension is blocked.
I thought about use a XMLHTTPRequest but I think the timeout is here the problem?
Then I tried to build an extension with the help of node.js but I have no idea how this should work in the end.
Can somebody help me? Or give me an idea? The best thing would be a code snippet which I can try.
Thank you so much for your reply.

Related

Would it be possible to create a Chromebook extension that would toggle the "Configure IP address automatically" network setting on and off?

Chromebooks at a certain facility will not work with static IPs, and they have reserved IP addresses, but for some odd reason they will not grab those from the DCHP server. By toggling Configure IP address automatically off for a few seconds and back on, the Chromebook gets its reserved IP and works fine. In about 6-8 months we will be changing the entire network and resolving this issue, but in the meantime if I could create a shortcut method for the end users to be able to do this easily it would be a big stone out of my shoe...
I had forgotten I posted this. In order to resolve the issue, I did use "code" and "programming" to create a script that would do what I described above. So, it wasn't a networking question, it was a programming question.

Serial COM port data over WebRTC

I'm currently looking at options to allow me to build a remote COM-port solution.
The idea is to be able to access from my remote PC, another PC that's directly connected to a device locally via its serial COM-port.
I know that the obivous answer is to use a VPN between the 2 Internet connected PCs.
However, I need this solution to be as seamless to the end-user as possible.
i.e. no installing and configuring VPN software, etc.
So I was thinking that WebRTC would be great because the end-user can simply use their web-browser and not have to install any additional software.
My question is, is it possible to stream the COM port data between the 2 PCs via WebRTC?
If so, can you please point me in the right direction as to how I can go about achieving this?
Sorry if this is a ridiculous question, I'm very new to WebRTC, just exploring my options.
Thanks.
That should work great!
Networking wise you get NAT Traversal. That means the two computers can be in completely different networks, and still communicate. You may have to run a TURN server if P2P isn't possible.
Data wise you can exchange anything you want via data channels. It is datagram based and you can send/receive binary data. You get a callback telling you how much has been delivered, that way you can detect backpressure.
Are you ok with installing software on the remote host? You can do something like Pion WebRTC's data-channels. This shows you can have a browser connect to a Go process via WebRTC. Then use tarm/serial on the remote host to interact with the device.
If you want a browser on both ends there is the Web Serial API I haven't used it myself though. That locks you into only doing Chromium which might be an issue.

Connecting two machines wirelessly without router or ad-hoc network

I have been struggling to find a definitive way to be able to connect my two computers wirelessly without a router and without setting up an ad-hoc network. I really hoped it would be as simple as changing my network adapter settings to have static IPs, say 192.168.5.10 on the first machine and then 192.168.5.11 on the other machine. But unfortunately, I can't even see these IPs on the output of ipconfig (or ifconfig). I have been researching this for quite a bit and no success yet... Any guidance would be greatly appreciated!!
Check WiFi-direct - it's designed for your use case. However, currently it's only supported by mobile devices (Android or iOS).
On desktop, maybe you could install an app and make one machine itself behave as a router, and let the other one connect to it. But I guess this solution doesn't solve your problem since it's no better than ad hoc mode.
The last solution I would suggest is a little painful: record MAC addresses of both machines, and generate the MAC frame by yourself somehow. This requires interception into the WiFi driver.

how to capture wlan packets

I have a program on my iPad that makes a direct TCP connection (bypassing the HTTP proxy settings in the Settings menu). I have been tasked to debug this, but I've been unable to find a way to capture the data stream (and the guy who compiles the program is not very responsive).
So... I've been trying to set my wlan to "no encryption at all", booting up Kali, putting the wlan interface into monitoring mode (airmon-ng start wlan0). Then started Wireshark & tried sniffing on both mon0 & wlan0. Neither did really result into anything useful.
That's what I did till now, but I'm out of ideas.
Does anyone know what way I can do it? (preferably even using Windows?)
What I want to get in the end is a pcap file (so I can look at it in Wireshark) of the data traffic. I'm not interested in the packets per se, but in the raw data transfer of the application.
Thanks!
Use another Laptop (Windows or Linux, your choice) with WLAN card in Promiscuous mode, which will sit besides your iPad and capture all the packets on air.
Check this for more details.
What I finally did: I own an Android telephone which could be rooted (and installed "Shark for Root"). So, I enabled a hotspot, connected my iPad to it, and dumped the traffic that way. Weird thing though is that I had to reboot my device to be able to download the pcap file to my computer. It could be read on the device by SharkReader though without reboot.
bitShark is another option, and looks much more nice, but I prefer the simpler interface of Shark for Root.

Is there a packet sniffer for Windows Mobile?

I'm looking for a tool along the lines of Fiddler, or better yet Wireshark, that would run on a Windows Mobile 6.1 device.
I have an app which calls some webservices on one of our servers, and I want to make sure it it going out to the proper address.
Whenever I want to test something like that I connect the device to my PC and use ActiveSync. The mobile device then can send all of it's internet requests through the PC. Wireshark can then be used to sniff the traffic coming in and out of the device. Works good and is a stable approach.
I recently had to search for this myself. There are a few of these out there but most are old and have not been updated recently. If you are looking for one to sniff the WiFi traffic it should be simple and Google should provide something suitable. However the issue I ran into (and could not get around with about 3hrs invested) was trying to sniff the EV-DO/Cell data connection. Seems the cell radio uses a different type of network driver then the WiFi connections on a WinMo device. Not much of an answer, sorry, but I figured I would share my experiences.
There is an experimental version of WinPCap for windows CE.
Maybe it will work for you.

Resources