Digitaclocean blockeing

In my localhost working correctly, but in droplet it’s not working because requesting to http from https. How much I understand I can not add ssl certificate for ip address. The solution is instead ip address use domain, but in this case I don’t know how to create open port for domain not for ip address.


const options = {
    cors: {
        origin: "",
        methods: ["GET", "POST"]
    transports: ['websocket', 'polling'],

const http = require('http').Server();
const io = require('')(http, options);

io.on('connection', function (socket) {
    socket.on('message', function (data) {
        io.sockets.emit('add-review', data);

http.listen(6001, '', function(){
    console.log('listening on *:6001');


var socket = io('https://ip-address:6001');

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @karenshahmuradyan,

You’ll need to use Nginx as a reverse proxy. What it does is, usually HTTP listens on por 80 and HTTPS listens on port 443. With Nginx, you can configure your domain to listen on those ports and internally relay traffic to port 6001 where your is. That’s what a reverse proxy is called.

That way you can install an SSL certificate on the Domain, the connection will be private and secured with going over HTTPS and you’ll be able to use Here is an article on how you can configure Nginx as a reverse proxy:

Regards, KFSys