Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.
This repository was archived by the owner on Apr 24, 2023. It is now read-only.

changing the default stun server #455

@amirtgm

Description

@amirtgm

I used the configs when I create my libp2p node and added my custom turn server to it like this:

transport: {
        WebRTCStar: {
          filter: filters.all,
          listenerOptions: {
            config: {
              iceServers: [
                {
                  urls: 'turn:*******',
                  username: '*****',
                  credential: '******',
                  credentialType: 'password',
                },
              ],
            },
          },
        },
      },

but after a long time of debugging, I found out that this customization is only happening for the listener part.
on the other hand, when a user tries to dial another one, there will be a new instance of simple peer with the default configuration.

I managed to resolve it by adding the configs to dial options but this shouldn't be the case right?

private dial = async (addr: Multiaddr, protocol: Protocols) => {
    return this.node.dialProtocol(addr, protocol, {
      spOptions: {
        config: {
          iceServers: [
           {
                  urls: 'turn:*******',
                  username: '*****',
                  credential: '******',
                  credentialType: 'password',
                },
          ],
        },
      },
    } as any);
  };

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upneed/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    Status

    🪵Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions