Skip to content

Examples? #6

@isaachess

Description

@isaachess

I'm struggling to use this effectively and am wondering if you could provide some examples.

The actually communication with the STUN server works fine: it returns the public addr observed by the STUN server.

But USING this information isn't working for me, and it has me wondering if I'm just misunderstanding how the package works (thus the request for examples).

For example, when calling stun.Discover it returns a conn and addr. I'm attempting, after performing the discover, to receive UDP packets sent to addr. So I'm trying to read from the return conn (while sending UDP messages to addr from another machine), but nothing ever comes through.

The purpose of STUN in my understanding is to hole-punch so peers can send UDP traffic to the public addr, which is then forwarded to the correct host. Can I see an example of how this package gets that done?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions