本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
846B

  1. // +build windows
  2. // Copyright 2016 The Gitea Authors. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package cmd
  6. import (
  7. "crypto/tls"
  8. "net/http"
  9. )
  10. func runHTTP(listenAddr string, m http.Handler) error {
  11. return http.ListenAndServe(listenAddr, m)
  12. }
  13. func runHTTPS(listenAddr, certFile, keyFile string, m http.Handler) error {
  14. return http.ListenAndServeTLS(listenAddr, certFile, keyFile, m)
  15. }
  16. func runHTTPSWithTLSConfig(listenAddr string, tlsConfig *tls.Config, m http.Handler) error {
  17. server := &http.Server{
  18. Addr: listenAddr,
  19. Handler: m,
  20. TLSConfig: tlsConfig,
  21. }
  22. return server.ListenAndServeTLS("", "")
  23. }
  24. // NoHTTPRedirector is a no-op on Windows
  25. func NoHTTPRedirector() {
  26. }
  27. // NoMainListener is a no-op on Windows
  28. func NoMainListener() {
  29. }
上海开阖软件有限公司 沪ICP备12045867号-1