- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 59 for websocket (0.06 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
okhttp/src/commonJvmAndroid/kotlin/okhttp3/WebSocket.kt
* limitations under the License. */ package okhttp3 import okio.ByteString /** * A non-blocking interface to a web socket. Use the [factory][WebSocket.Factory] to create * instances; usually this is [OkHttpClient]. * * ## Web Socket Lifecycle * * Upon normal operation each web socket progresses through a sequence of states: *
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Mar 10 21:45:14 GMT 2026 - 6.1K bytes - Click Count (0) -
docs/en/docs/advanced/websockets.md
# WebSockets { #websockets } You can use [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) with **FastAPI**. ## Install `websockets` { #install-websockets } Make sure you create a [virtual environment](../virtual-environments.md), activate it, and install `websockets` (a Python library that makes it easy to use the "WebSocket" protocol): <div class="termy"> ```console $ pip install websockets ---> 100% ```Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 07 09:29:03 GMT 2026 - 5.3K bytes - Click Count (0) -
docs/zh-hant/docs/advanced/websockets.md
# WebSockets { #websockets } 你可以在 **FastAPI** 中使用 [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)。 ## 安裝 `websockets` { #install-websockets } 請先建立[虛擬環境](../virtual-environments.md)、啟用它,然後安裝 `websockets`(一個讓你更容易使用「WebSocket」通訊協定的 Python 套件): <div class="termy"> ```console $ pip install websockets ---> 100% ``` </div> ## WebSockets 用戶端 { #websockets-client }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 5.2K bytes - Click Count (0) -
docs/zh/docs/advanced/websockets.md
# WebSockets { #websockets } 您可以在 **FastAPI** 中使用 [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)。 ## 安装 `websockets` { #install-websockets } 请确保您创建一个[虚拟环境](../virtual-environments.md)、激活它,并安装 `websockets`(一个让使用“WebSocket”协议更容易的 Python 库): <div class="termy"> ```console $ pip install websockets ---> 100% ``` </div> ## WebSockets 客户端 { #websockets-client }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 5.4K bytes - Click Count (0) -
docs/ja/docs/advanced/websockets.md
# WebSockets { #websockets } **FastAPI**で[WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)が使用できます。 ## `websockets`のインストール { #install-websockets } [仮想環境](../virtual-environments.md)を作成し、それを有効化してから、「WebSocket」プロトコルを簡単に使えるようにするPythonライブラリの`websockets`をインストールしてください。 <div class="termy"> ```console $ pip install websockets ---> 100% ``` </div> ## WebSockets クライアント { #websockets-client }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 6.8K bytes - Click Count (0) -
docs_src/app_testing/tutorial002_py310.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)
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 757 bytes - Click Count (0) -
docs_src/websockets_/tutorial003_py310.py
self.active_connections: list[WebSocket] = [] async def connect(self, websocket: WebSocket): await websocket.accept() self.active_connections.append(websocket) def disconnect(self, websocket: WebSocket): self.active_connections.remove(websocket) async def send_personal_message(self, message: str, websocket: WebSocket): await websocket.send_text(message)
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 27 12:34:37 GMT 2026 - 2.5K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/internal/ws/WebSocketRecorder.kt
webSocket: WebSocket, code: Int, reason: String, ) { Platform.get().log("[WS $name] onClosed $code", Platform.INFO, null) val delegate = delegate if (delegate != null) { this.delegate = null delegate.onClosed(webSocket, code, reason) } else { events.add(Closed(code, reason)) } } override fun onFailure( webSocket: WebSocket, t: Throwable,Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Feb 03 22:17:59 GMT 2026 - 6.8K bytes - Click Count (0) -
docs/ko/docs/advanced/testing-websockets.md
# WebSocket 테스트하기 { #testing-websockets } 같은 `TestClient`를 사용하여 WebSocket을 테스트할 수 있습니다. 이를 위해 `with` 문에서 `TestClient`를 사용하여 WebSocket에 연결합니다: {* ../../docs_src/app_testing/tutorial002_py310.py hl[27:31] *} /// note 자세한 내용은 Starlette의 [WebSocket 테스트](https://www.starlette.dev/testclient/#testing-websocket-sessions) 문서를 확인하세요.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 453 bytes - Click Count (0) -
tests/test_dependency_after_yield_websockets.py
app = FastAPI() @app.websocket("/ws") async def websocket_endpoint(websocket: WebSocket, session: SessionDep): await websocket.accept() for item in session: await websocket.send_text(f"{item}") @app.websocket("/ws-broken") async def websocket_endpoint_broken(websocket: WebSocket, session: BrokenSessionDep): await websocket.accept() for item in session:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 2K bytes - Click Count (0)