+ 11

How to non-remotely connect to server using Node?

How to non-remotely connect to a internet server using Node? Just like how browser access a site, how to make node JS do that? Note that, both requests(post/get) should be able to be done and specific headers should also be possible to sent and that's non-remotely! Just like how browser does. I've tried to connect my localserver (it has config if no remote access) using Node. Using browser, it's working server. Using Node, it doesn't connect like a browser? Server returns runtime error--- non-remote access only, use browser. Why? How to solve it?😕

12th Jul 2019, 5:36 PM
Sarthak Pokhrel
Sarthak Pokhrel - avatar
5 ответов
+ 7
Checker 8763 There's nothing like XMLHttpRequest in node JS. Third party apps can help node to stimulate browser. But instead of that, I want to make it like a browser itself. (I'm not talking about processing HTML CSS AND JAVASCRIPT executing and evaluating)
13th Jul 2019, 4:16 AM
Sarthak Pokhrel
Sarthak Pokhrel - avatar
+ 2
I don't exactly know but what you mean but maybe xmlhttprequest is what xou are looking for.
12th Jul 2019, 6:38 PM
Checker 8763
Checker 8763 - avatar
+ 2
Space🇳🇵 {{It Starts, it ends!}}ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ So are you looking for a nodejs XMLHttpRequest equivalent? For that you'd use the http(s) built-in library, or a third party library (for example I like node-fetch off npm, it wraps the built in modules to copy the browser fetch api). You can mention me if you want some examples of http requests in node.
13th Jul 2019, 4:40 AM
JS Coder
+ 2
Try to type in the IP of your Server in the Browser. It might have a GUI Server
13th Jul 2019, 8:34 AM
Loeschzwerg
0
Qale s
14th Jul 2019, 3:51 PM
Safarà