Room-House.com Russia
  • SkyPirl (Pirl)
    • О SkyPirl
    • Создать кошелек SkyPirl 2.0
    • Как стать номинатором (Stake)
    • Запустить валидатор
    • как вывести средства со стейка
    • Как работает выплата
    • Как проголосовать за Совет
    • Как установить личность
    • косая черта
    • Refund of slashed
    • ХАРАКТЕРИСТИКИ МОНЕТ
    • Правительство и казначейство
    • Telemetry
    • Source Code
  • PIRLmeet
    • О PIRLmeet.com
    • Бесплатная пробная версия
    • CINEMA
    • Microphone On-Off
    • Демонстрация экрана
      • Поделитесь или не делитесь своим аудио
      • Учебное пособие по записи видео + камера + загрузка видео в формате mp4
    • Руки вверх
    • Изменить мелодию звонка при поднятии руки
    • Потоковое видео в формате MP4
    • Потоковое видео mp4 в браузере Firefox
    • Замок шкафа
      • Учетная запись блокировки кабинета
      • Как я могу «запереть шкаф» и не дать посторонним войти в комнату?
      • Как я могу добавить людей в комнату, когда комната заблокирована?
    • Подключить кошелек SkyPirl к PIRLmeet
    • Изменить обложку
    • Название видео
    • Настройка собственного PIRLmeet
    • Как скачать видео на ютуб, фейсбук и конвертировать в мп4 файлы
    • Используйте приложение для улучшения камеры во время прямой трансляции
    • PIRLmeet может организовывать встречи, которые длятся 24/7 и 365 дней в году.
    • Как PIRLmeet защищает продукты?
    • Получите монету Pirl при воспроизведении видео на PIRLmeet
    • Source Code
  • SkyPirl Light Wallet
  • Сообщество SkyPirl
  • Бизнес-парадигма R-H
  • Дорожная карта
  • Команда SkyPirl
  • хТер . Технологии
    • О xTER SafeContainer
    • xTer Экосистема
    • xTer SkyPirl
    • xTer Room-House
      • Как Room-House
    • xTer Room-House Plus
      • Как xTer room-House plus
    • xTer TrueAD
    • xTer SmartFilter
  • Белая бумага
  • Блог
    • Новости
      • ------ Что такое Web 1.0, 2.0, 3.0?------
      • Первый в мире децентрализованный аудиочат Room-House
      • Что такого особенного в децентрализованных аудиочатах?
      • Особенности, которые делают децентрализованные чаты Room-House.com конкурентоспособными с гигантами
      • Вы когда-нибудь слышали о децентрализованном благотворительном фонде?
      • Что такое онлайн-встреча? 4 самых эффективных решения для онлайн-конференций
      • Что такое онлайн-встреча? Легко или сложно организовать?
      • Каков стандарт профессиональной онлайн-комнаты для совещаний?
      • История первого в мире программного обеспечения для онлайн-конференций
      • Децентрализованное приложение Room-House.com (Daap)
      • В каком году родился интернет? И рождение проекта SkyPirl
      • Сотрудничество между Room-House и Российским государственным социальным университетом
    • Технические
      • Что такое биткойн? Как создаются биткойны?
      • Export Your Private Key from Third-Party Wallets
      • Что такое стейблкоин?
      • Что такое обернутый биткойн?
      • 7 способов получения пассивного дохода с помощью криптовалюты
      • Что такое децентрализованная социальная сеть?
      • Сколько биткойнов можно добыть за день?
      • Сколько биткойнов в мире?
      • Что такое децентрализованная биржа? отличается от централизованного этажа?
      • Что такое стейкинг? 5 вещей, которые следует учитывать при инвестировании в стейкинг
      • Что такое блокчейн-мосты?
      • Сравните горячий кошелек и холодный кошелек, какой из них вам следует использовать?
      • Что такое НФТ?
      • Создание децентрализованного интернета в космосе
      • Веб 3.0 Парадокс
      • Споры о будущем Интернета
      • Виртуальная вселенная метавселенной может произвести революцию в Интернете
      • «Блокчейн — самая влиятельная технология со времен Интернета»
      • Web3 - Ожидания от децентрализованного Интернета
      • Что такое дапп? Понятие Dapp и их классификация
      • Как децентрализованные веб-браузеры обеспечивают непревзойденную конфиденциальность
      • Web 3.0 раскручен?
      • Что такое узлы? Типы узлов в блокчейне
      • Блокчейн можно взломать или нет?
      • Что такое закрытый ключ и открытый ключ в биткойнах?
      • Что такое одноразовый номер в блокчейне?
      • Что такое децентрализованный автономный кооператив (DAC)?
      • Что такое Генезис Блок?
      • Что такое Веб3? Объяснение децентрализованного Интернета будущего
  • FAQ?
    • General
      • Getting Started
      • Claims
      • Redenomination of DOT
      • Grants
      • Polkadot Ambassador Programme
      • Research Pages
      • Community
      • Contributing
      • Contributors
      • Glossary
      • Adding accounts to an ENS domain
      • Ledger Application
      • How to Protect Yourself from Scams
      • How to Do Your Own Research
      • Thousand Validators Programme
      • Frequently Asked Questions (FAQs)
      • Miscellaneous
      • Programmes
        • Grants
        • Bug Bounty
        • Substrate Builders Program
        • Thousand Validators Programme
        • Thousand Contributors Programme
    • Learn
      • Basics
        • Token and Assets
          • Assets
          • DOT
          • NFTs
          • Statemint
          • Teleporting Assets
        • Components
          • Architecture
          • Collator
          • Consensus
          • Governance
          • Identity
          • Network Security
          • Nominator
          • Polkadot Host
          • PolkadotJS
          • W3F Registrar
          • Runtime Upgrades
          • Transaction Fees
          • Treasury
          • Validator
        • Staking
          • Staking Concepts
          • Staking FAQ
          • Nomination Pools
        • Account
          • Account Generation
          • Backing up and Restoring Accounts
          • Balance Transfers
      • Advanced
        • Availability and Validity
        • Cross-Consensus Message Format (XCM)
        • Sequential Phragmén Method
        • Proxy Accounts
        • Randomness
        • Simple Payouts
        • SPREE
        • WebAssembly (Wasm)
      • Cryptography
        • Cryptography Explainer
        • Keys
      • Paraobjects
        • Parachains
          • Common Good Parachains
          • Parachain Slots Auction
          • Parachain Crowdloans
          • Teleporting Assets
        • Parathreads
        • Bridges
      • Polkadot Comparisons
        • Polkadot and Kusama
        • Other Comparisons
        • Ethereum 2.0
        • Cosmos
      • Polkadot Lauch Phased
      • Video Tutorials
    • Build
      • Builder's Guides
      • Development Guide
        • Builders Starter's Guide
        • Parachain Development
        • Decentralized Storage Systems
        • Smart Contracts
        • Oracles
        • Data Analytics
        • Wallets
        • Substrate Connect
        • SS58 Registry
        • Opening HRMP Channels
      • Integration Guide
        • Polkadot Integration Guide
        • Polkadot Protocol Information
        • Integration Assets
        • Node Management
        • Node Interaction
        • Transaction Construction and Signing
      • Tool
      • Resources
    • Maintain
      • Network Maintainers
      • Parameters
      • Node Endpoints
      • Node And Dapps
        • Set up a Full Node
        • Networks
        • Set up Secure WebSocket for Remote Connections
        • Resolving Errors
      • Nominated Guides
        • Nominate
        • Unbonding and Rebonding
      • Validator Guides
        • How to run a Validator on Polkadot
        • Validator Payout Overview
        • Using systemd for a Validator Node
        • Secure Validator
        • How to use Polkadot Validator setup
        • Set Up a Validator with NGINX Reverse Proxy
        • How to Upgrade Your Validator
        • Monitor your node
        • How to Chill
        • How to Stop Validating
        • Validator Community Overview
      • Governance Guides
        • Participate in Democracy
        • Join the Council
        • Voting for Councillors
  • Agency policy
    • Information privacy policy
Powered by GitBook
On this page
  • Set up a node​
  • Set up a certificate​
  • Set up Nginx server​
  • Importing the Certificate​
  • Connecting to the node​
  1. FAQ?
  2. Maintain
  3. Node And Dapps

Set up Secure WebSocket for Remote Connections

PreviousNetworksNextResolving Errors

Last updated 2 years ago

You might want to host a node on one server and then connect to it from a UI hosted on another, e.g. . This will not be possible unless you set up a secure proxy for websocket connections. Let's see how we can set up WSS on a remote Substrate node.

Note: this should only be done for sync nodes used as back-end for some dapps or projects. Never open websockets to your validator node - there's no reason to do that and it can only lead to security gaffes.

In this guide we'll be using Ubuntu 18.04 hosted on a \$10 DigitalOcean droplet. We'll assume you're using a similar OS, and that you have nginx installed (if not, run sudo apt-get install nginx).

Set up a node

Whether it's a generic Substrate node, a Kusama node, or your own private blockchain, they all default to the same websocket connection: port 9944 on localhost. For this example, we'll set up a Kusama sync node (non-validator).

Create a new server on your provider of choice or locally at home (preferred). We'll assume you're using Ubuntu 18.04. Then install Substrate and build the node.

curl https://getsubstrate.io -sSf | bashgit clone https://github.com/paritytech/polkadot kusamacd kusama./scripts/init.shcargo build --release./target/release/polkadot --name "DigitalOcean 10 USD droplet ftw" --rpc-cors all

This will start the syncing process with Kusama's mainnet.

THE --rpc-cors MODE NEEDS TO BE SET TO ALL SO THAT ALL EXTERNAL CONNECTIONS ARE ALLOWED

Set up a certificate

To get WSS (secure websocket), you need an SSL certificate. There are two possible approaches.

Domain and Certbot

The first approach is getting a dedicated domain, redirecting its nameservers to your IP address, setting up an Nginx server for that domain, and finally for Nginx setup. This will auto-generate an SSL certificate and include it in your Nginx configuration. This will let you connect Polkadot-JS UI to a URL like mynode.mydomain.com rather than 82.196.8.192:9944, which is arguably more user friendly.

This is simple to do on cloud hosting providers or if you have a static IP, but harder to pull off when running things from your home server.

Self-signed

The second approach and one we'll follow here is generating a self-signed certificate and relying on the raw IP address of your node when connecting to it.

Generate a self-signed certificate.

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crtsudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048

Now it's time to tell Nginx to use these certificates. The server block below is all you need, but keep in mind that you need to replace some placeholder values. Notably:

  • SERVER_ADDRESS should be replaced by your domain name if you have it, or your server's IP address if not.

  • CERT_LOCATION should be /etc/letsencrypt/live/YOUR_DOMAIN/fullchain.pem if you used Certbot, or /etc/ssl/certs/nginx-selfsigned.crt if self-signed.

  • CERT_LOCATION_KEY should be /etc/letsencrypt/live/YOUR_DOMAIN/privkey.pem if you used Certbot, or /etc/ssl/private/nginx-selfsigned.key if self-signed.

  • CERT_DHPARAM should be /etc/letsencrypt/ssl-dhparams.pem if you used Certbot, and /etc/ssl/certs/dhparam.pem if self-signed.

server {        server_name SERVER_ADDRESS;        root /var/www/html;        index index.html;        location / {          try_files $uri $uri/ =404;          proxy_buffering off;          proxy_pass http://localhost:9944;          proxy_set_header X-Real-IP $remote_addr;          proxy_set_header Host $host;          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;          proxy_http_version 1.1;          proxy_set_header Upgrade $http_upgrade;          proxy_set_header Connection "upgrade";        }        listen [::]:443 ssl ipv6only=on;        listen 443 ssl;        ssl_certificate CERT_LOCATION;        ssl_certificate_key CERT_LOCATION_KEY;        ssl_session_cache shared:cache_nginx_SSL:1m;        ssl_session_timeout 1440m;        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;        ssl_prefer_server_ciphers on;        ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS";        ssl_dhparam CERT_DHPARAM;}

Restart nginx after setting this up: sudo service nginx restart.

If you used the self-signed certificate approach, modern browsers will not let you connect to this websocket endpoint without that certificate being imported - they will emit an NET:ERR_CERT_AUTHORITY_INVALID message.

Every websocket connection bootstraps itself with https first, so to allow the certificate, visit the IP of your machine in the browser prefixed with https, like so: https://MY_IP. This should produce a "Not private" warning which you can skip by going to "Advanced" and the clicking on "Proceed to Site". You have now whitelisted this IP and its self-signed certificate for connecting.

Now you have a secure remote connect setup for your Substrate node.

Set up Nginx server

Note that if you used Certbot, it should have made the path insertions below for you if you followed the

Importing the Certificate

Connecting to the node

Open and click the logo in the top left to switch the node. Activate the "Development" toggle and input your node's address - either the domain or the IP address. Remember to prefix with wss:// and if you're using the 443 port, append :443, like so: wss://example.com:443.

Polkadot-JS UI
​
​
​
following LetsEncrypt instructions
​
​
official instructions
​
​
Polkadot-JS UI