How to capture all internet traffic in node - node.js

I am looking to make an application (with electron preferably) that can route all internet traffic on a device (currently targeting Windows) and tunnel/stream it through a socket (maybe using socket.io or socket.io-stream). Essentially what would be happening is an OpenVPN-like thing only using web technology.
I am wondering if there is a way of sniffing out all internet bound traffic from any/all programs or windows itself and route it. Any help would greatly be appreciated.

The answers in Making a program that intercepts network traffic in Windows seem relevant, and there's a Node module you could try.

Related

Why my web traffic is redirected via IP 10.0.0.11 address on my Mac?

I know nothing about networking. so I need serious help here. I was on a Zoom call with my mentor and we were talking about the difference between HTTP, HTTP1, and HTTP2. Then he noticed that even websites which are supposed to use HTTP1 all of them were showing as if they are using HTTP2.
He mentioned possible problems are:
I'm using VPN
or my web traffic is redirected via a Proxy server. (which I'm not since I work from home via my wifi provided to me via fiber optic cable)
I suspect that there is some kind of proxy malware on my laptop. Can anybody tell me how can i detect any possible malware and find out in general what is wrong? (if anything is wrong at all)
Thanks in advance.
The range from 10.0.0.0 to 10.255.255.255 is one of the private IP Ranges and as you are using wifi its normally assigned by your wifi-router/accesspoint to your computer using dhcp.
But seriously, a professor who thinks he is capable talking about http(x) should know the very basics of the protocol stack. If he doesn't know such simple things, you better get someone better.

how to enable wsl to respond to broadcast ping request

I was using WSL to run ROS commands, and at a point i had to enable system to respond to broadcast icmp requests (for a multi master kind of a setup) i.e. on linux i had to make sure
cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
returns 0. but WSL does not contain such a file, so i was thinking of enabling it on windows. All the sources i have gone through suggest me to add a rule to firewall but my system is not responding to broadcast ping even when my system's firewall is turned off(domain, private and public have been turned off same with my buddy who is no the same network). i am using an android phone's mobile hotspot to check this.
it would be great if someone could help me on this.
thanks in advance.
I asked something similar
I don't know how to do it purely on WSL. But on windows you have to start the "TCPSVCS.EXE" process. located on System32

how to communicate with my apps using IP address and socket remotely

I am to Electron and nodejs
And stuck here, actually i m making a desktop app to control every PC in network. which tells me the ip and mac of computers in the network. But now I need to talk to it and push/get some message. but how ?
Socket.io is likely the easiest way to do what you are trying to do. It'll allow you to communicate between the machines with a relatively low amount of effort.
Sockets generally work on a "server" and "client" basis, so you may want a central server that will coordinate with the clients.
This blog post from node source provides a really good intro to using them.

Hosting a web application on an ad-hoc network in linux

This is my first question on SO. Basically, I am attempting to create a sort of offline neighborhood forum. I have setup NodeBB to host a forum locally, but the problem is allowing users to connect. Eventually I plan to use a high-strength wireless router to broadcast an open network, and from there redirect all traffic to the local page. In the mean time, I was wondering if it would be possible to implement this with by means of an ad-hoc network. Broadcasting an ad-hoc network seems easy enough, but how might I redirect the traffic to the port running NodeBB? Any help or comments on the overall idea would be greatly appreciated.
By default, NodeBB listens on all network interfaces (0.0.0.0), so if you set up an ad-hoc network, anybody connected to your machine will be able to access it via MACHINE_IP:4567.
If you have your machine behind a NAT/Router, you'll have to forward port 4567 to your machine. Alternatively, you could translate requests from external port 80 to port 4567, though that is untested for NodeBB specifically.

Listening a particular port on linux to access data comes from mobile device

i am newbie to Linux platform, i am working on java technology.
what i have to do is : Having a program that running on mobile devices,that sends some data to my Linux machine, now i have to create a program in java that
listen to a particular port.
access data comes on that port(which is sending by mobile device)
save that data to the database.
response back to the mobile device.
i.e. i would make my Linux system as server that can listen from many clients(mobile devices), but not getting how to configure this environment... :(
i used cent OS 5.4 and
installed jdk1.6.0_24
any help would be appreciated.....
thanx in advance!
khushi
One of Java's greatest strengths is that you can pretty much ignore the host operating system as long as you stick to core Java features. In the case you're describing, you should be able to accomplish everything by simply using the standard Java networking APIs and either the JDBC to access an existing, external database or you could choose any number of embedded Java databases such as Derby. For your stated use case, that you'll be running the application on Linux is pretty much irrelevant (which should be good news... you don't need to learn a whole operating system in addition to writing your app ;-).
Here's a nice client/server tutorial, in that it is broken into steps, and adds each new concept in another step.
Here's another client/server tutorial with much more detail.
I would write it to accept one connection at a time. Once that works, I would study the new(ish) java.lang.concurrent classes, in particular the ExecutorService, as a way of managing the worker bee handling each connection. Then change your program to handle multiple connections using those classes. Breaking it up in two steps like that will be a lot easier.

Resources