0

I have a program that serves pages via http (without SSL) on windows. I want to make that secure if it's possible.

I tried to write my own middle-ware but I failed. It worked but it can't handle web-sockets. Here is my code if anyone wants something simpler: link

If anyone can recommend a program that runs on Windows and can act as a proxy server, serves pages via SSL and supports POST requests and Web-Sockets.

Thanks. I’m looking forward to your reply.

0

I found a solution to my proplem: I use nginx as a proxy server.

Here is my conf file:

worker_processes  2;

events {
    worker_connections  1024;
}

http {
    sendfile on;

    #https proxy server
    server {
        listen               443 ssl;
        server_name          localhost;
        ssl_certificate      ../ssl/cert.crt;
        ssl_certificate_key  ../ssl/private.key;

        location / {
            proxy_pass       http://127.0.0.1:80/;
            proxy_set_header X-Forwarded-For $remote_addr;
        }

        location /ws/ {
            proxy_pass         http://127.0.0.1:80/$request_uri;
            proxy_http_version 1.1;
            proxy_set_header   X-Forwarded-For $remote_addr;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection "Upgrade";
        }

    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.