Unable to SSH tunnel to hit private API
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- node.js, typescript
- 領域
- backend, networking
調査の方向性
issue の例にある ssh.connection?.forwardOut から始め、コマンドライン SSH トンネルとその転送動作を比較します。node-ssh の転送 API を確認し、localhost:8081 への Axios リクエストを検証します。SSH セッションを開いたままプライベート API エンドポイントが応答すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Hey all,
I have a server in a private subnet that is hosting a REST API on port 80 and a jump box in a public subnet that I would like to tunnel through so that I can invoke the REST API in the same execution with axios. When I run the command line command to tunnel everything works fine:
ssh -i "keypair.pem" -L 8081:<API HOST>:80 <JUMP BOX USER>@<JUMP BOX IP>
Once I run that command, as long as I keep the session open, I can hit the API through Postman/Axios. All good.
I am trying to do the same thing with this library, but the connection is not being exposed properly and I can't figure out why. Here is my code:
const ssh = new NodeSSH();
await ssh.connect({
host: '<JUMP BOX IP>',
username: '<JUMP BOX USER>',
privateKey: `RSA KEY`
});
ssh.connection?.forwardOut('127.0.0.1', 8081, <API HOST>, 80);
const response = await axios.get(`http://localhost:8081/<ENDPOINT PATH>`);
The connection opens fine and I can exec commands as I want. This issue may be a result of using async/await as well, but I would like to stick using that model if possible.
Thanks in advance for the eyes and any ideas.
- 主要言語
- TypeScript
- スター
- 1k
- フォーク
- 94
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
steelbrain/node-ssh のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
steelbrain/node-ssh#487 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
steelbrain/node-ssh#482 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
steelbrain/node-ssh#474 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
steelbrain/node-ssh#473 · コメント 1 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
steelbrain/node-ssh#472 ·
steelbrain/node-ssh の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
lingdojo/kana-dojo#34127 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
osmlab/name-suggestion-index#13104 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100