Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for DefaultServeMux (0.37 sec)

  1. src/net/http/doc.go

    # Servers
    
    ListenAndServe starts an HTTP server with a given address and handler.
    The handler is usually nil, which means to use [DefaultServeMux].
    [Handle] and [HandleFunc] add handlers to [DefaultServeMux]:
    
    	http.Handle("/foo", fooHandler)
    
    	http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) {
    		fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
    	})
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  2. src/net/http/cgi/child.go

    // an error is returned. The provided handler may be nil to use
    // [http.DefaultServeMux].
    func Serve(handler http.Handler) error {
    	req, err := Request()
    	if err != nil {
    		return err
    	}
    	if req.Body == nil {
    		req.Body = http.NoBody
    	}
    	if handler == nil {
    		handler = http.DefaultServeMux
    	}
    	rw := &response{
    		req:    req,
    		header: make(http.Header),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  3. src/net/http/fcgi/child.go

    // If l is nil, Serve accepts connections from os.Stdin.
    // If handler is nil, [http.DefaultServeMux] is used.
    func Serve(l net.Listener, handler http.Handler) error {
    	if l == nil {
    		var err error
    		l, err = net.FileListener(os.Stdin)
    		if err != nil {
    			return err
    		}
    		defer l.Close()
    	}
    	if handler == nil {
    		handler = http.DefaultServeMux
    	}
    	for {
    		rw, err := l.Accept()
    		if err != nil {
    			return err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  4. src/net/http/http_test.go

    		"net/http.(*Transport).RoundTrip": true,
    
    		// Verify these don't exist:
    		"net/http.http2Server":           false,
    		"net/http.(*Server).Serve":       false,
    		"net/http.(*ServeMux).ServeHTTP": false,
    		"net/http.DefaultServeMux":       false,
    	}
    	for sym, want := range wantSym {
    		got := bytes.Contains(out, []byte(sym))
    		if !want && got {
    			t.Errorf("cmd/go unexpectedly links in HTTP server code; found symbol %q in cmd/go", sym)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 18:18:19 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  5. src/net/http/server.go

    }
    
    // NewServeMux allocates and returns a new [ServeMux].
    func NewServeMux() *ServeMux {
    	return &ServeMux{}
    }
    
    // DefaultServeMux is the default [ServeMux] used by [Serve].
    var DefaultServeMux = &defaultServeMux
    
    var defaultServeMux ServeMux
    
    // cleanPath returns the canonical path for p, eliminating . and .. elements.
    func cleanPath(p string) string {
    	if p == "" {
    		return "/"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 123.4K bytes
    - Viewed (0)
  6. src/net/http/cgi/host.go

    	// should handle internal redirects when the CGI process
    	// returns a Location header value starting with a "/", as
    	// specified in RFC 3875 ยง 6.3.2. This will likely be
    	// http.DefaultServeMux.
    	//
    	// If nil, a CGI response with a local URI path is instead sent
    	// back to the client and not redirected internally.
    	PathLocationHandler http.Handler
    }
    
    func (h *Handler) stderr() io.Writer {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 20:46:32 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  7. src/net/http/fcgi/fcgi_test.go

    		1, 4, 0, 1, 0, 10, 0, 0, 50, 50, 3, 4, 5, 6, 7, 8, 9, 10,
    		// end of params
    		1, 4, 0, 1, 0, 0, 0, 0,
    	}
    	rw := rwNopCloser{bytes.NewReader(input), io.Discard}
    	c := newChild(rw, http.DefaultServeMux)
    	c.serve()
    }
    
    // a series of FastCGI records that start and end a request
    var streamFullRequestStdin = bytes.Join([][]byte{
    	// set up request
    	makeRecord(typeBeginRequest, 1,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 11 18:51:39 UTC 2023
    - 10.6K bytes
    - Viewed (0)
  8. src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go

    				http.Error(w, "permission denied", http.StatusForbidden)
    				return
    			}
    		}
    		h := args.Handlers[req.URL.Path]
    		if h == nil {
    			// Fall back to default behavior
    			h = http.DefaultServeMux
    		}
    		h.ServeHTTP(w, req)
    	})
    
    	// We serve the ui at /ui/ and redirect there from the root. This is done
    	// to surface any problems with serving the ui at a non-root early. See:
    	//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 19:48:28 UTC 2024
    - 14K bytes
    - Viewed (0)
  9. src/net/http/pprof/pprof.go

    //
    // By default, all the profiles listed in [runtime/pprof.Profile] are
    // available (via [Handler]), in addition to the [Cmdline], [Profile], [Symbol],
    // and [Trace] profiles defined in this package.
    // If you are not using DefaultServeMux, you will have to register handlers
    // with the mux you are using.
    //
    // # Parameters
    //
    // Parameters can be passed via GET query params:
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 17:34:05 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  10. src/net/http/h2_bundle.go

    	BaseConfig *Server
    
    	// Handler specifies which handler to use for processing
    	// requests. If nil, BaseConfig.Handler is used. If BaseConfig
    	// or BaseConfig.Handler is nil, http.DefaultServeMux is used.
    	Handler Handler
    
    	// UpgradeRequest is an initial request received on a connection
    	// undergoing an h2c upgrade. The request body must have been
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 364.1K bytes
    - Viewed (0)
Back to top