Skip to content

Using the option config.WithURL should infer the scheme #202

Open
@jonstacks

Description

@jonstacks

What I expected to happen

When making a config.Tunnel that looks like the following:

tunnelConfig := config.HTTPEndpoint(
        config.WithURL("http://foo.bar.internal:80"),
)

I expected the scheme to automatically be inferred as "http".

What actually happened

It ended up defaulting the endpoint scheme to "https" and the endpoint showed up as a https endpoint in the ngrok dashboard.

I then had to also pass:

tunnelConfig := config.HTTPEndpoint(
        config.WithURL("http://foo.bar.internal:80"),
        config.WithScheme("http"), // This had to be added
)

In order to get it to work

Proposed change

We should make it so that if you supply a scheme in the URL, it is respected and you don't have to also specify it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions