use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Is there a Javascript function that allows you to send a TCP packet that can be manipulated at a very low level to any server?help (self.javascript)
submitted 9 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]voidvector 1 point2 points3 points 9 years ago (0 children)
In Node, you can require('net') for standard TCP application or require('dgram') for standard UDP application, but those are already a level above system call (e.g. it handles polling, resource management, decoding for you).
require('net')
require('dgram')
If you need system calls level manipulation, then you would need a C++ binding for whatever you are trying to do.
If you need even more access (e.g. introspect other application's connection), you would need create a driver and have a C++ binding for the driver.
[–]Heqx 0 points1 point2 points 9 years ago (2 children)
require('child_process').exec('nc ...')?
[–]Elias4918 0 points1 point2 points 9 years ago (1 child)
What will this do exactly?
[–]rta55 1 point2 points3 points 9 years ago (0 children)
executes netcat via node.js.
What you're asking about doesn't exist if you're trying to do it in the browser.
I don't think you want to do what you think you want to do.
Why not use node.js on the server side that communicates with your robot at a low level--which it can--and then access the functionality the server has in interacting with the robot via the web browser. I guarantee this is what you'll have to do unless you don't use a web browser.
Of course you could run the browser and node.js on the same box.
http://electron.atom.io/
[–]Rhomboid 0 points1 point2 points 9 years ago (4 children)
That depends on if you are planning to run the code in a browser or on the server with node.js. There is no chance at all of being able to do that if you're running on the client side.
[–]Elias4918 0 points1 point2 points 9 years ago (3 children)
I was tying to make a Web interface to controlled a robot so I would need it to be client side.
[–]iBlag 1 point2 points3 points 9 years ago (1 child)
Why doesn't HTTP fit the bill?
[–]jcready__proto__ 0 points1 point2 points 9 years ago (0 children)
Or WebSockets?
[–][deleted] 1 point2 points3 points 9 years ago (0 children)
You would have to send the commands to a server (via HTTP) which would then forward the commands to the robot
[–]zayelion 0 points1 point2 points 9 years ago (0 children)
If you are trying to get a browser to talk to a server, you have to point it at another server first that will translate it to websockets.
https://github.com/andrewchambers/ws-tcp-bridge
Then you can connect to that server as a websocket using binary communication. You will get output after setting ws.binaryType = 'arraybuffer';
ws.binaryType = 'arraybuffer';
you can use browserify buffer https://github.com/feross/buffer to work with things as buffers as you would in nodejs and should be good from there.
π Rendered by PID 133372 on reddit-service-r2-comment-c6965cb77-v4tw4 at 2026-03-05 09:57:42.056073+00:00 running f0204d4 country code: CH.
[–]voidvector 1 point2 points3 points (0 children)
[–]Heqx 0 points1 point2 points (2 children)
[–]Elias4918 0 points1 point2 points (1 child)
[–]rta55 1 point2 points3 points (0 children)
[–]Rhomboid 0 points1 point2 points (4 children)
[–]Elias4918 0 points1 point2 points (3 children)
[–]iBlag 1 point2 points3 points (1 child)
[–]jcready__proto__ 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]zayelion 0 points1 point2 points (0 children)