Can we make our own web server to host a websites and respond to HTTP requests? - iis

A web server responds to an HTTP request and sends the client a set of HTML, CSS, and JS files.
After we build a website or a web application, we usually have to host it on a well-known web server like IIS or Apache to make it accessible all around the world (on the internet).
Can't we just make our own web server so that it can responds to all incoming HTTP requests that the client sends to our computer without having to use IIS?

As wazz and Lex says, you could build your own server to listen the special port and handle the request based on your requirement, but it contains performance and security issue.
If you still want to build it by yourself. I suggest you could refer to some existing server like KestrelHttpServer.

Related

how to use nginx 3rd party module when proxying connections to application servers

I developed a Nginx 3rd party dynamic module and did required configuration in nginx.conf. Able to run that module and see it doing processing. This module reads request request header, cookies etc., does some business logic execution and modify response header then send back response to client.
Problem -: "How to use nginx module when proxying connections to application servers"
I'm be using Nginx as proxy server and Tomcat or Node as application server and my application hosted on app server. I'm able to route the request through both web & app server and get response back but module isn't getting invoked. Not sure how to link/configure it so that my able to intercept request and modify response header as per need.
Flow -: Browser <-> Web Server (module sits here) <-> Application Server
Has anybody explored this part? If yes then please help.

Can NodeJs - http module be hosted to process ASP/.NET web site pages?

I want to host website locally which would be accessed with a embedded Browser Control on a Desktop application.
I am trying to find a solution by hosting a http listener with the capability to process the ASP.NET/CSHTML(Razor) server pages.
NodeJS is an option to host a http listner, but how to register/associate the ASP Http Handler to NodeJs-HttpModule for processing these server pages.
Is this possible?
Thank you very much for your interest in my query. Please help.

What happens when a server without SSL makes an HTTPS request to a server that does?

In these instances, what happens? Does communication fall back to HTTP? I'm assuming that communication will either fail, or fallback, depending on the setup of the ssl-enabled destination server.
Example Case:
A plugin that is installed on Server A (which may or may not have SSL), communicates with an API that functions over HTTPS on Server B.
I think your question is not clear enough. Do you mean, with "a server without SSL", that
The server system has no kind of SSL software installed. In this case of course no SSL requests can be done from the server.
Or that the web server itself is only available by HTTP and not HTTPS, but there is a script on it which needs to access other hosts by HTTPS. In this case it can do these requests if the required software is installed on the server and if the target host is available by HTTPS and if no firewalls blocks the connections etc. Configuration of the web server itself has nothing to do what kind of requests programs on the web server can do.

How to get full request URL in Node.js running on Heroku

I'm running a node application on heroku and I would like to find the full request URL through which my application is being requested. In particular, I want to know if it has been accessed through HTTP or HTTPS, so that I can redirect clients connecting through HTTP to use the same URL but with HTTPS instead.
Since the application is running under proxies, etc., the protocol and host portions of the requests I can read are the ones where node is running, as forwarded by Heroku infrastructure.
Hints appreciated!
BTW, my app uses requestjs, in case that is relevant

Connecting to Node.js server from a website?

So say, you have:
A VPS running a Node.js server
A web host & domain that's running a website say www.example.com
Is there a way you can have www.example.com connect to the Node.js server and retrieve data from it?
Because I just started messing around with node, and I've looked at over 10 tutorials and read a bunch of implementations of Node.js and in all of their examples they say connect to localhost:8080 or 127.0.0.1:8080. (That would mean my vps would have to host www.example.com (the client) & the node.js (the server) for me to use both??)
But I haven't come across any code/tutorials that allows me to run a JavaScript script to connect to the Node.js server and load in data dynamically from the page I'm at. Thanks.
Here's an example of code I'm looking at. http://tympanus.net/codrops/2012/10/11/real-time-geolocation-service-with-node-js/
Yes, you can use any URL to reach a nodeJs server.
Routing a request (to say www.example.com) to a nodeJs server has nothing to do with the nodeJs server. You have to make sure that the routing rules are in place, but that is completely separate to your server.
Update in response to you comment clarification:
Are you trying to make connections:
client -> example.com -> node.js?
If so, and example.com is a standard server, then yes, just make calls to node.js URL, that'll work fine
If you looking for the below flow
node.js
client/
\
example.com
And if you client is a browser, then you will have to deal with cross-domain issues as discussed here AJAX cross domain call

Resources