Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 82 for ws (0.11 sec)

  1. tests/test_tutorial/test_websockets/test_tutorial002_an_py310.py

            with client.websocket_connect("/items/foo/ws"):
                pytest.fail(
                    "did not raise WebSocketDisconnect on __enter__"
                )  # pragma: no cover
    
    
    @needs_py310
    def test_websocket_invalid_data(app: FastAPI):
        client = TestClient(app)
        with pytest.raises(WebSocketDisconnect):
            with client.websocket_connect("/items/foo/ws?q=bar&token=some-token"):
                pytest.fail(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/internal/ws/WebSocketWriterTest.kt

     */
    package okhttp3.internal.ws
    
    import assertk.assertThat
    import assertk.assertions.isEqualTo
    import java.util.Random
    import kotlin.test.assertFailsWith
    import okhttp3.TestUtil.repeat
    import okhttp3.internal.format
    import okhttp3.internal.ws.WebSocketProtocol.OPCODE_BINARY
    import okhttp3.internal.ws.WebSocketProtocol.OPCODE_TEXT
    import okhttp3.internal.ws.WebSocketProtocol.PAYLOAD_BYTE_MAX
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  3. tests/test_http_connection_injection.py

        return conn.app.state.value
    
    
    @app.get("/http")
    async def get_value_by_http(value: int = Depends(extract_value_from_http_connection)):
        return value
    
    
    @app.websocket("/ws")
    async def get_value_by_ws(
        websocket: WebSocket, value: int = Depends(extract_value_from_http_connection)
    ):
        await websocket.accept()
        await websocket.send_json(value)
        await websocket.close()
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Aug 09 13:56:41 GMT 2020
    - 972 bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/ws/WebSocketRecorder.kt

      ) {
        Platform.get().log("[WS $name] onOpen", Platform.INFO, null)
        val delegate = delegate
        if (delegate != null) {
          this.delegate = null
          delegate.onOpen(webSocket, response)
        } else {
          events.add(Open(webSocket, response))
        }
      }
    
      override fun onMessage(
        webSocket: WebSocket,
        bytes: ByteString,
      ) {
        Platform.get().log("[WS $name] onMessage", Platform.INFO, null)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.9K bytes
    - Viewed (0)
  5. okhttp/src/test/resources/web-platform-test-urltestdata.txt

    ftp://foo:21/  s:ftp h:foo p:/
    ftp://foo:80/  s:ftp h:foo port:80 p:/
    gopher://foo:70/  s:gopher h:foo p:/
    gopher://foo:443/  s:gopher h:foo port:443 p:/
    ws://foo:80/  s:ws h:foo p:/
    ws://foo:81/  s:ws h:foo port:81 p:/
    ws://foo:443/  s:ws h:foo port:443 p:/
    ws://foo:815/  s:ws h:foo port:815 p:/
    wss://foo:80/  s:wss h:foo port:80 p:/
    wss://foo:81/  s:wss h:foo port:81 p:/
    wss://foo:443/  s:wss h:foo p:/
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/AutobahnTester.kt

    import java.util.concurrent.atomic.AtomicReference
    import okhttp3.internal.USER_AGENT
    import okio.ByteString
    
    /**
     * Exercises the web socket implementation against the
     * [Autobahn Testsuite](http://autobahn.ws/testsuite/).
     */
    class AutobahnTester {
      val client = OkHttpClient()
    
      private fun newWebSocket(
        path: String,
        listener: WebSocketListener,
      ): WebSocket {
        val request =
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  7. fastapi/exception_handlers.py

    from starlette.exceptions import HTTPException
    from starlette.requests import Request
    from starlette.responses import JSONResponse, Response
    from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY, WS_1008_POLICY_VIOLATION
    
    
    async def http_exception_handler(request: Request, exc: HTTPException) -> Response:
        headers = getattr(exc, "headers", None)
        if not is_body_allowed_for_status_code(exc.status_code):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  8. internal/grid/manager.go

    package grid
    
    import (
    	"context"
    	"crypto/tls"
    	"fmt"
    	"net/http"
    	"runtime/debug"
    	"strings"
    
    	"github.com/gobwas/ws"
    	"github.com/gobwas/ws/wsutil"
    	"github.com/google/uuid"
    	"github.com/minio/madmin-go/v3"
    	"github.com/minio/minio/internal/pubsub"
    	"github.com/minio/mux"
    )
    
    const (
    	// apiVersion is a major version of the entire api.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  9. docs_src/app_testing/tutorial002.py

    from fastapi.testclient import TestClient
    from fastapi.websockets import WebSocket
    
    app = FastAPI()
    
    
    @app.get("/")
    async def read_main():
        return {"msg": "Hello World"}
    
    
    @app.websocket("/ws")
    async def websocket(websocket: WebSocket):
        await websocket.accept()
        await websocket.send_json({"msg": "Hello WebSocket"})
        await websocket.close()
    
    
    def test_read_main():
        client = TestClient(app)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Feb 08 10:23:07 GMT 2023
    - 757 bytes
    - Viewed (0)
  10. internal/config/heal/heal.go

    	if err != nil {
    		return cfg, fmt.Errorf("'heal:max_io' value invalid: %w", err)
    	}
    	if ws := env.Get(EnvDriveWorkers, kvs.GetWithDefault(DriveWorkers, DefaultKVS)); ws != "" {
    		w, err := strconv.Atoi(ws)
    		if err != nil {
    			return cfg, fmt.Errorf("'heal:drive_workers' value invalid: %w", err)
    		}
    		if w < 1 {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 11 01:10:30 GMT 2024
    - 4.9K bytes
    - Viewed (0)
Back to top