Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any TLS support is coming ? #36

Closed
ahmedxfn opened this issue Feb 28, 2022 · 2 comments · Fixed by #37
Closed

Any TLS support is coming ? #36

ahmedxfn opened this issue Feb 28, 2022 · 2 comments · Fixed by #37

Comments

@ahmedxfn
Copy link

No description provided.

@ahmedxfn
Copy link
Author

ahmedxfn commented Mar 1, 2022

Just ignore it, I have the Listener exposed from easytcp so I can use it with tls.NewListner, not yet tested though.

@ahmedxfn ahmedxfn closed this as completed Mar 1, 2022
@DarthPestilane
Copy link
Owner

How about add a ServeTLS method to Server ?

func (s *Server) ServeTLS(addr string, config *tls.Config) error {
	address, err := net.ResolveTCPAddr("tcp", addr)
	if err != nil {
		return err
	}
	lis, err := net.ListenTCP("tcp", address)
	if err != nil {
		return err
	}
	s.Listener = tls.NewListener(lis, config)
	if s.printRoutes {
		s.router.printHandlers(fmt.Sprintf("tcp://%s", s.Listener.Addr()))
	}
	return s.acceptLoop()
}

@DarthPestilane DarthPestilane linked a pull request Mar 21, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants