{"id":13339239,"url":"https://github.com/Narazaka/shiori_proxy-nim","last_synced_at":"2025-03-11T12:31:38.452Z","repository":{"id":70967804,"uuid":"112728495","full_name":"Narazaka/shiori_proxy-nim","owner":"Narazaka","description":"SHIOLINK - SHIORI-BASIC implementation","archived":false,"fork":false,"pushed_at":"2018-01-20T21:55:52.000Z","size":21,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-10T18:53:22.099Z","etag":null,"topics":["shiori","ukagaka"],"latest_commit_sha":null,"homepage":null,"language":"Nim","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/Narazaka.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}},"created_at":"2017-12-01T10:41:15.000Z","updated_at":"2023-10-28T17:10:04.000Z","dependencies_parsed_at":"2023-03-11T09:35:14.372Z","dependency_job_id":null,"html_url":"https://github.com/Narazaka/shiori_proxy-nim","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Narazaka%2Fshiori_proxy-nim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Narazaka%2Fshiori_proxy-nim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Narazaka%2Fshiori_proxy-nim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Narazaka%2Fshiori_proxy-nim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Narazaka","download_url":"https://codeload.github.com/Narazaka/shiori_proxy-nim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243034969,"owners_count":20225437,"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","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":["shiori","ukagaka"],"created_at":"2024-07-29T19:19:54.211Z","updated_at":"2025-03-11T12:31:38.442Z","avatar_url":"https://github.com/Narazaka.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shiori_proxy\r\n\r\nSHIORI-Basic の実装です。\r\n\r\n## 概要\r\n\r\n伺かにおけるSHIORIサブシステムはアンマネージドdllによる実装が仕様となっていますが、\r\nコンソールアプリケーションの方が一般に作成しやすいです。\r\n\r\nこのshiori_proxy.dllは、コンソールアプリケーションとの標準入出力でSHIORIサブシステムを実現するためのラッパーです。\r\n\r\n## ダウンロード・利用\r\n\r\n[Releases](https://github.com/Narazaka/shiori_proxy-nim/releases) から最新のdllをダウンロードして下さい。\r\n\r\nそれを`ghost/master/shiori_proxy.dll`に配置し、`descript.txt`に`shiori,shiori_proxy.dll`と記述して下さい。\r\n\r\nまた下記で説明している`shiori_proxy.yml`を適切に記述し、SHIORIプロセスプログラムを呼び出すように設定して下さい。\r\n\r\n## 設定\r\n\r\n`shiori_proxy.yml`で行います\r\n\r\n```yaml\r\ncommand: # 実行コマンド 引数を配列にしたもの\r\n- node.exe\r\n- shiori.js\r\n- ./dict\r\n# timeout: 5 # タイムアウト秒 (未実装)\r\n```\r\n\r\n### command 実行コマンド\r\n\r\nshiori_proxy.dllは、SHIORI load()時にコマンドを実行してSHIORIプロセスを立ち上げ、SHIORI unload()時にそれを終了します。\r\n\r\nload()時に立ち上げるコマンド引数を配列で記述します。\r\n\r\n### timeout タイムアウト秒 (未実装)\r\n\r\nSHIORIプロセスにリクエストを投げてもこの秒数以内にレスポンスが帰ってこなかった場合、shiori_proxy.dllはSHIORIプロセスがハングしたとみなし、異常終了します。\r\n\r\nベースウェアの実装によってはベースウェアごと落ちますが、そうしない場合ベースウェアごと無限にフリーズして操作不能となる場合が存在する(SSPなど)ので、このような処理をする可能性があります。\r\n\r\n## プロトコル\r\n\r\nshiori_proxy.dllとSHIORIプロセスの間の通信プロトコルは以下のようなものです。\r\n\r\n| 種別 | shiori_proxy.dll | SHIORIプロセス |\r\n|---|---|---|\r\n| (SHIORIプロセス起動) | | |\r\n| load() リクエスト | LOAD SHIORIPROXY/1.0[CRLF]\u003cbr\u003eC:\\\\SSP\\\\ghost\\\\ikaga\\\\ghost\\\\master\\\\[CRLF] | |\r\n| load() レスポンス | | 1[CRLF] |\r\n| request() リクエスト | REQUEST SHIORIPROXY/1.0[CRLF]\u003cbr\u003eGET SHIORI/3.0[CRLF]\u003cbr\u003eCharset: Shift_JIS[CRLF]\u003cbr\u003eSender: ikagaka[CRLF]\u003cbr\u003eID: version[CRLF]\u003cbr\u003e[CRLF] | |\r\n| request() レスポンス | | SHIORI/3.0 200 OK[CRLF]\u003cbr\u003eCharset: Shift_JIS[CRLF]\u003cbr\u003eSender: ikaga[CRLF]\u003cbr\u003eValue: 1.0.0[CRLF]\u003cbr\u003e[CRLF] |\r\n| unload() リクエスト | UNLOAD SHIORIPROXY/1.0[CRLF] | |\r\n| unload() レスポンス | | 1[CRLF] |\r\n| (SHIORIプロセス終了) | | |\r\n\r\n## 文字コード\r\n\r\nshiori_proxy.dllはSHIORIプロセスに標準入力でSHIORIリクエストなどを受け渡し、標準出力からSHIORIレスポンスなどを受け取ります。\r\n\r\nベースウェアからはShift_JISまたはUTF-8でリクエストが来ることになりますが、実行コマンドでの扱いが簡単になるよう、shiori_proxy.dll内で文字コード変換を行います。\r\n\r\n通信時の文字コードは以下のようになります。\r\n\r\n- ベースウェアとshiori_proxy.dllの間はSHIORIリクエスト/レスポンスに含まれるCharsetヘッダの文字コード\r\n- shiori_proxy.dllとSHIORIプロセスの間はUTF-8\r\n\r\nこのときSHIORIリクエストやレスポンスに付加されているCharsetヘッダは書き換えることなく文字コードのみ変換します。\r\n\r\nなのでSHIORIプロセスが標準入力から読んだSHIORIリクエストはCharsetヘッダと実際の文字コードが異なる場合が存在します。\r\n\r\nまたCharsetヘッダと実際の文字コードが異なる状態でSHIORIプロセスから標準出力へSHIORIレスポンスを書き込む事も出来ます。\r\n\r\n一覧すると、リクエスト、レスポンスともに以下のような状態になります。\r\n\r\n| ベースウェア(SSP等) \u003c-\u003e shiori_proxy.dll | shiori_proxy.dll \u003c-\u003e SHIORIコマンド |\r\n|---|---|\r\n| Charset: Shift_JIS (実際=Shift_JIS) | Charset: Shift_JIS (実際=UTF-8) |\r\n| Charset: UTF-8 (実際=UTF-8) | Charset: UTF-8 (実際=UTF-8) |\r\n\r\n## ビルド\r\n\r\n### shiori_proxy.dll\r\n\r\n```bash\r\nnimble install\r\nnimble dll32\r\n```\r\n\r\n### shiori_proxy.exe + myshiori.exe (テスト用)\r\n\r\n```bash\r\nnimble install\r\nnimble install shiori\r\nnimble example\r\n```\r\n\r\n## License\r\n\r\nThis is released unser [MIT License](https://narazaka.net/license/MIT?2018)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNarazaka%2Fshiori_proxy-nim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNarazaka%2Fshiori_proxy-nim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNarazaka%2Fshiori_proxy-nim/lists"}