Skip to content

A simple TCP server that accepts messages from a remote client and executes predefined functions based on those messages

Notifications You must be signed in to change notification settings

bryanchance/.NETCore-ngrok-remote-tcp-server

 
 

Repository files navigation

.NET Core TCP server with ngrok

This illustrates a TCP Server listening on all network interfaces on a random port on your local machine and using ngrok to expose it to the internet.

The concept here can be used to create and communicate with services in an entreprise settings for small tasks like log management etc.

The Ngrok.cs class downloads and extract the ngrok executable depending on your OS.

To run

Make sure you have .NET Core installed. You must have an ngrok authtoken first.

> git clone https://github.com/maxwellobi/.NETCore-ngrok-remote-tcp-server.git TCPRemoteServer
> cd TCPRemoteServer
> dotnet restore
> dotnet run --authtoken "abcdefghijklmnopqrstuvwxyz"

If run successfully you will see the ngrok tunnel public url which can then be used by any TCP Client to connect

Connecting to TCP Server

You can connect any TCP Client to this server or build your own. For instance, you can use netcat

About

A simple TCP server that accepts messages from a remote client and executes predefined functions based on those messages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%