{"id":39508049,"url":"https://github.com/mobiusy/dify_plugins","last_synced_at":"2026-01-18T06:00:37.936Z","repository":{"id":322969360,"uuid":"1091616890","full_name":"mobiusy/dify_plugins","owner":"mobiusy","description":"Dify插件：http流式输出","archived":false,"fork":false,"pushed_at":"2025-12-05T07:10:31.000Z","size":28,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-08T14:21:58.929Z","etag":null,"topics":["dify-plugins","http","httpstream","sse"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mobiusy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-07T09:13:51.000Z","updated_at":"2025-12-05T07:04:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mobiusy/dify_plugins","commit_stats":null,"previous_names":["mobiusy/dify_plugins"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mobiusy/dify_plugins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobiusy%2Fdify_plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobiusy%2Fdify_plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobiusy%2Fdify_plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobiusy%2Fdify_plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mobiusy","download_url":"https://codeload.github.com/mobiusy/dify_plugins/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobiusy%2Fdify_plugins/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28531991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dify-plugins","http","httpstream","sse"],"created_at":"2026-01-18T06:00:23.153Z","updated_at":"2026-01-18T06:00:37.925Z","avatar_url":"https://github.com/mobiusy.png","language":"Python","readme":"# Dify Plugin: http_request_stream\n[中文版](./README.zh.md)\n\nA plugin for sending HTTP requests and returning response content as a stream. It is especially suitable for integrating with HTTP services that support streaming output (such as SSE or chunked responses), and continuously emits the stream content to the Answer node in real time.\n\n## Basic Info\n- Author: mobiusy\n- Version: 0.0.3\n- Type: tool\n\n## Feature Highlights\n\n### Streaming Requests and Output\n- Sends HTTP requests (supports GET/POST/PUT/DELETE/HEAD/PATCH) and reads streaming responses in real time\n- Built-in SSE-compatible headers (Accept: text/event-stream / Connection: keep-alive / Cache-Control: no-cache)\n- Continuously outputs streamed text to the Answer node as a variable named `stream_text`\n\n### Request Body Support\n- Supports an optional JSON request body (provided as a string), automatically parsed and sent with the request\n\n### Robust Error Handling\n- Validates URL format (must start with http:// or https://)\n- Friendly error messages for non-2xx HTTP status codes\n- Connection stage timeout control (5s connection timeout; no overall read timeout to avoid interrupting the stream)\n\n## Installation and Quick Start\n\n1. Install this plugin in Dify (via Marketplace or local package import)\n2. Add the tool `http_request_stream` in a Workflow or Toolflow\n3. In the Answer node, select \"Streaming output\" and reference the variable `stream_text` to display real-time content\n\n\u003e Note: This plugin does not require additional credential configuration.\n\n## Usage Examples\n\n### 1) GET request to fetch streaming data\n```yaml\ntool: http_request_stream\nparameters:\n  method: \"GET\"\n  url: \"https://httpbin.org/stream/10\"\n```\n\n### 2) POST request with JSON body and streaming response\n```yaml\ntool: http_request_stream\nparameters:\n  method: \"POST\"\n  url: \"https://example.com/sse\"\n  body: \"{\\\"query\\\": \\\"hello\\\", \\\"user_id\\\": 123}\"\n```\n\n### 3) Display stream output in the Answer node\n- Set the Answer node content to reference `{{stream_text}}`\n- When the remote service keeps returning streaming text, the Answer node will keep updating the display\n\n### 4) Convert text to stream (Typewriter effect)\n```yaml\ntool: text_to_stream\nparameters:\n  content: \"Hello, this is a streaming test.\"\n  delay: 50\n  chunk_size: 1\n```\n\n## Tool Reference\n\n| Tool | Description | Key Parameters |\n|------|-------------|----------------|\n| `http_request_stream` | Sends an HTTP request and returns response text as a stream | `method` (options: GET/POST/PUT/DELETE/HEAD/PATCH), `url` (required), `body` (optional JSON string) |\n| `text_to_stream` | Converts input text to stream output (typewriter effect) | `content` (required), `delay` (default: 20ms), `chunk_size` (default: 2) |\n\n### Parameter Details\n- `method` (required, select): HTTP method, default `GET`\n- `url` (required, string): Full request URL (must start with http:// or https://)\n- `body` (optional, string): Request body in JSON string form (only provide when needed; must be valid JSON)\n\n### Output Variable\n- `stream_text`: Each streamed text fragment received by the tool is immediately emitted as this variable, which can be used for dynamic display in the Answer node\n\n## Error Handling\n\n- Empty or invalid URL: raises `httpx.InvalidURL`\n- Non-2xx status code: raises `httpx.HTTPStatusError` with the status code\n- JSON parsing failure: raises `ValueError` when `body` is not a valid JSON string\n- Network errors or interruptions: catches and raises `httpx.HTTPError` or other exceptions to aid troubleshooting\n\n## Limitations and Notes\n\n- Only supports HTTP/HTTPS URLs\n- The server must support streaming output (SSE or chunked responses) to continuously return content; otherwise, it may respond once and end\n- Custom headers or authentication parameters are not supported in the current version; if needed, extend support in the tool logic\n- `body` supports only JSON string format\n\n## FAQ and Troubleshooting\n\n1. \"URL must start with http:// or https://\": Ensure the URL prefix is correct\n2. \"HTTP Error: \u003cstatus_code\u003e\": The server returned a non-2xx status code; check whether the API is functioning and whether parameters are correct\n3. \"body must be a valid JSON string.\": `body` must be a valid JSON string; use double quotes and ensure it can be parsed\n4. Long periods without output: The target endpoint may not support streaming, or output may be blocked by a gateway/proxy\n\n## Development Notes\n\nThis plugin is built with the Dify plugin framework and follows the \"one file, one tool class\" best practice:\n- Tool definition: `tools/http_request_stream.yaml`\n- Tool implementation: `tools/http_request_stream.py` (class name: `HttpRequestStreamTool`)\n- Provider configuration: `provider/http_request_stream.yaml`; this plugin currently does not require credentials\n\nImplementation highlights:\n- Uses `httpx.stream` for streaming reads and sets SSE-compatible headers\n- Each line of streamed text is emitted via `create_stream_variable_message(\"stream_text\", line)`\n\n## License\n\nThis plugin is provided as-is for use with Dify. Refer to Dify's license terms for details on usage rights.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobiusy%2Fdify_plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobiusy%2Fdify_plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobiusy%2Fdify_plugins/lists"}