Skip to content

[gui] protocol discriminator #768

@dskvr

Description

@dskvr

Certain local checks cannot be conducted (without a proxy at least) when protocols do not match.

Right now, there are a number of assumptions when it comes to local checks (audits, nip-11 fetches, etc)

  1. The web-app is ran on is https://
  2. The websocket being connected to is wss://
  3. The server fetching from is https://

Add a discriminator with that populates application capabilities that can be used in conditions to enable/disable features

  1. When app is running on HTTPS, only HTTPS/WSS relays can be connected to client side
  2. When app is running on HTTP, only HTTP/WS relays can be connected to client side

Additionally, in preparation for alternative network data

  1. When app is running on TOR, only TOR relays can be connected to client-side (for now)
  2. When app is runnning on clearnet, only clearnet relays can be conected to client-side (unless tor proxy is defined)

Note
There's potential complexity and conflicts with the logic above since tor relays run on ws://

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions