{"id":31702344,"url":"https://github.com/newbienewbie/indirectline","last_synced_at":"2025-10-08T21:51:05.895Z","repository":{"id":48114042,"uuid":"184493973","full_name":"newbienewbie/InDirectLine","owner":"newbienewbie","description":"Your own DirectLine that runs without Azure","archived":false,"fork":false,"pushed_at":"2024-03-06T01:01:50.000Z","size":1693,"stargazers_count":23,"open_issues_count":0,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-23T02:42:52.402Z","etag":null,"topics":["azure-bot-service","bot-framework","botbuilder","directline","webchat","weixin-bot"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/newbienewbie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-05-01T23:19:02.000Z","updated_at":"2025-07-31T06:51:24.000Z","dependencies_parsed_at":"2024-03-06T02:24:36.311Z","dependency_job_id":"54c58d36-ae66-4abe-b50c-165d67cd45f0","html_url":"https://github.com/newbienewbie/InDirectLine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/newbienewbie/InDirectLine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newbienewbie%2FInDirectLine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newbienewbie%2FInDirectLine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newbienewbie%2FInDirectLine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newbienewbie%2FInDirectLine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newbienewbie","download_url":"https://codeload.github.com/newbienewbie/InDirectLine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newbienewbie%2FInDirectLine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000701,"owners_count":26082837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"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":["azure-bot-service","bot-framework","botbuilder","directline","webchat","weixin-bot"],"created_at":"2025-10-08T21:51:02.175Z","updated_at":"2025-10-08T21:51:05.891Z","avatar_url":"https://github.com/newbienewbie.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![InDirectLine@GitHub](https://github.com/newbienewbie/InDirectLine/workflows/InDirectLine-GitHub/badge.svg)\n\n# InDirectLine\n\nAzure rocks. But sometime we need **Host our own `DirectLine` \u0026 [Bot Framework](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-overview-introduction?view=azure-bot-service-4.0) without Azure**.\nFor example, test [webchat](https://github.com/Microsoft/BotFramework-WebChat) with no internet. :)\n\n\u003cdiv\u003e\n\u003cdiv style=\"height:400px\"\u003e\n\u003cimg style=\"float: left; height: 400px; padding: 2em;\" alt=\"WebChat-demo\" src=\"https://github.com/newbienewbie/InDirectLine/blob/master/Itminus.InDirectLine.Samples/Itminus.InDirectLine.IntegrationBotSample/webchat-demo.png?raw=true\" /\u003e\n\n\u003cimg style=\"float: left; height: 400px; padding: 2em\" alt=\"WeChat MP demo\" src=\"https://github.com/newbienewbie/InDirectLine/blob/master/Itminus.InDirectLine.Samples/Itminus.InDirectLine.IntegrationBotSample/Wechat-demo.png?raw=true\" /\u003e\n\u003c/div\u003e\n\u003cdiv style=\"clear: both;\"\u003e\u003c/div\u003e\n\u003cdiv\u003e\n   \n## How it works\n\nActually, the `DirectLine` is a **bridge** that connects your bot and your client. This project (`InDirectLine`) is a custom implementation of my own written using [ASP.NET Core](https://github.com/aspnet/AspNetCore).\n\nFor more details, see [Direct Line API 3.0](https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-concepts?view=azure-bot-service-4.0)\n\n## Features \u0026 ToDo\n\n* [x] REST API for normal messages\n* [x] WebSocket support\n* [x] Attachment support\n    * [X] Basic support : allow uploading\n    * [x] allow download\n* [x] Security\n    * [x] Token Generate \u0026 Refresh API\n    * [x] Any user can only access his own conversation data\n* [ ] Persistene Layer \u0026 InMemory storage \u0026 clean up resources automatically\n* [X] Wechat MP support\n* [ ] Unit Tests\n\n## How to Use\n\nTypically, `InDirectLine` will be used as an standlone server ([Itminus.InDirectLine.Web](https://github.com/newbienewbie/InDirectLine/tree/master/Itminus.InDirectLine.Web)). In this way, the `InDirectLine` \u0026 your `Bot` are two different processes. You could create your `Bot` in `C#`/`Node.js`/`Python`/`Java` languages as you like.\n\n### WebChat\n\nIn order to use `Directline` with `WebChat`, we need create a `directLine` instance by `WebChat.createDirectLine()` firstly:\n\n```html\n\u003cdiv id=\"webchat\" role=\"main\"\u003e\u003c/div\u003e\n\u003cscript src=\"https://cdn.botframework.com/botframework-webchat/latest/webchat-minimal.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n        var userId =\"User-\"+ parseInt(Math.random()* 1000000);\n        var userName = userId;\n        fetch('/v3/directline/tokens/generate', { \n            method: 'POST',\n            headers:{\n                \"Content-Type\":\"application/json\",\n            },\n            body: JSON.stringify({ userId: userId, password: \"\"}),\n        })\n        .then(res =\u003e res.json())\n        .then(res =\u003e {\n            var directLine = window.WebChat.createDirectLine({\n                domain: \"/v3/directline\",\n                token: res.token,\n            });\n            window.WebChat.renderWebChat({\n                directLine: directLine,\n                userID: userId,\n                username: userName,\n                locale: 'en-US',\n            }, document.getElementById('webchat'));\n        });\n\u003c/script\u003e\n```\nNote the `domain` has no trailing slash `/`. \n\nThe `WebChat` will use `WebSocket` by default. If you want a `REST` way, set the `webSocket=false`:\n\n```javascript\n    var directLine = window.WebChat.createDirectLine({\n        domain: \"http://localhost:3000/v3/directline\",\n        token: 'YOUR_DIRECT_LINE_TOKEN',\n        webSocket:false, \n    });\n```\n\n### WeChat\n\nSee [Itminus.InDirectLine.IntegrationBotSample](https://github.com/newbienewbie/InDirectLine/tree/master/Itminus.InDirectLine.Samples/Itminus.InDirectLine.IntegrationBotSample).\n\n\n### `InDirectLine` Configuration\n\nThe `InDirectLine` reads the `appsettings.json` file by default, which means it should listen on `http://localhost:3000` and assumes that the `http://127.0.0.1:5000/api/messages` is the bot message endpoint.\n\nYou could create a `appsettings.Development.json` or a `appsettings.Production.json` and configure the options as you like. To use other ports, see [Itminus.InDirectLine.IntegrationBotSample](https://github.com/newbienewbie/InDirectLine/tree/master/Itminus.InDirectLine.Samples/Itminus.InDirectLine.IntegrationBotSample).\n\nAlso you could pass the settings by [command line arguments](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.2#arguments) or by [environment variables](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.2#environment-variables-configuration-provider). \n\nFor more details, see [Microsoft Docs](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewbienewbie%2Findirectline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewbienewbie%2Findirectline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewbienewbie%2Findirectline/lists"}