angelobreuer/localtunnel.net

How to use as library?

Closed this issue · 1 comments

I am trying using this as library in a .net core project.
I was able to install it from nuget but unable to create a new tunnel.
Can you please publish a tutorial or an example please?

Hello, @barMperez.
Thank you for your issue!

The following snippet demonstrates how to create a secured tunnel using localtunnel-client:

using System.Threading.Tasks;
using Localtunnel;
using Localtunnel.Connections;

using var client = new LocaltunnelClient();
var options = new ProxiedSslTunnelOptions { };

var tunnel = await client.OpenAsync(
    connectionFactory: x => new ProxiedSslTunnelConnection(x, options),
    subdomain: "my-domain");

await Task.Delay(-1);

I have also added the above snippet to the readme.