# frp
```go
import "github.com/Akilan1999/p2p-rendering-computation/p2p/frp"
```
## Index
- [func GetFRPServerPort\(host string\) \(string, error\)](<#GetFRPServerPort>)
- [func StartFRPCDockerContainer\(ipaddress string, port string, Docker \*docker.DockerVM\) \(\*docker.DockerVM, error\)](<#StartFRPCDockerContainer>)
- [func StartFRPClientForServer\(ipaddress string, port string, localport string, remoteport string\) \(string, error\)](<#StartFRPClientForServer>)
- [func StartFRPProxyFromRandom\(\) \(int, error\)](<#StartFRPProxyFromRandom>)
- [type Client](<#Client>)
- [func \(c \*Client\) StartFRPClient\(\) error](<#Client.StartFRPClient>)
- [type ClientMapping](<#ClientMapping>)
- [type Server](<#Server>)
- [func \(s \*Server\) StartFRPServer\(\) error](<#Server.StartFRPServer>)
## func [GetFRPServerPort]()
```go
func GetFRPServerPort(host string) (string, error)
```
GetFRPServerPort Gets the port no from the FRPServer to establish the FRP connection needed.
## func [StartFRPCDockerContainer]()
```go
func StartFRPCDockerContainer(ipaddress string, port string, Docker *docker.DockerVM) (*docker.DockerVM, error)
```
## func [StartFRPClientForServer]()
```go
func StartFRPClientForServer(ipaddress string, port string, localport string, remoteport string) (string, error)
```
StartFRPClientForServer Starts Server using FRP server returns back a port remote port is a custom external port a user would want to open. This under the assumption the user knows the exact port available in server doing the TURN connection.
## func [StartFRPProxyFromRandom]()
```go
func StartFRPProxyFromRandom() (int, error)
```
StartFRPProxyFromRandom starts reverse proxy server based on a random port generated
## type [Client]()
Client This struct stores client information with server proxy connected
```go
type Client struct {
Name string
Server *Server
ClientMappings []ClientMapping
}
```
### func \(\*Client\) [StartFRPClient]()
```go
func (c *Client) StartFRPClient() error
```
StartFRPClient Starts FRP client
## type [ClientMapping]()
ClientMapping Stores client mapping ports to proxy server
```go
type ClientMapping struct {
LocalIP string
LocalPort int
RemotePort int
}
```
## type [Server]()
```go
type Server struct {
// contains filtered or unexported fields
}
```
### func \(\*Server\) [StartFRPServer]()
```go
func (s *Server) StartFRPServer() error
```
StartFRPServer The initial plan is only support reverse proxy for TCP ports This function starts a server that can act as a reverse proxy for nodes behind NAT.
Generated by [gomarkdoc]()