Home / Function/ RunListener() — gin Function Reference

RunListener() — gin Function Reference

Architecture documentation for the RunListener() function in gin.go from the gin codebase.

Function go CoreEngine Middleware calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  87d071bd_480a_e635_b237_cc68d91f720b["RunListener()"]
  6644ac8c_4250_d0a5_24d0_3c468a58ea64["RunFd()"]
  6644ac8c_4250_d0a5_24d0_3c468a58ea64 -->|calls| 87d071bd_480a_e635_b237_cc68d91f720b
  3a2c3baf_05dd_1c1d_c903_494ce21d8dff["isUnsafeTrustedProxies()"]
  87d071bd_480a_e635_b237_cc68d91f720b -->|calls| 3a2c3baf_05dd_1c1d_c903_494ce21d8dff
  574d40af_3b9a_ed63_5543_dccb95923f9d["Handler()"]
  87d071bd_480a_e635_b237_cc68d91f720b -->|calls| 574d40af_3b9a_ed63_5543_dccb95923f9d
  style 87d071bd_480a_e635_b237_cc68d91f720b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

gin.go lines 645–659

func (engine *Engine) RunListener(listener net.Listener) (err error) {
	debugPrint("Listening and serving HTTP on listener what's bind with address@%s", listener.Addr())
	defer func() { debugPrintError(err) }()

	if engine.isUnsafeTrustedProxies() {
		debugPrint("[WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\n" +
			"Please check https://github.com/gin-gonic/gin/blob/master/docs/doc.md#dont-trust-all-proxies for details.")
	}

	server := &http.Server{ // #nosec G112
		Handler: engine.Handler(),
	}
	err = server.Serve(listener)
	return
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does RunListener() do?
RunListener() is a function in the gin codebase.
What does RunListener() call?
RunListener() calls 2 function(s): Handler, isUnsafeTrustedProxies.
What calls RunListener()?
RunListener() is called by 1 function(s): RunFd.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free