Skip to content

Add HttpAdapter for extension localhost access and NativeExecAdapter for host command execution #5

Description

@WhatisTech

Extensions cannot make HTTP requests to localhost. The sandboxed extension host blocks fetch() and Node.js http, preventing connections to local language servers, documentation tools, and development services running on the host.
The built-in terminal cannot run development tools. The sandbox has no access to HiShell binaries (git, cargo, rustc, node) and no package manager, forcing developers to switch to external terminals or VMs for every build/test operation.
Extensions have no API to execute native commands. vscode.tasks.executeTask is restricted to the sandboxed environment, so build, test, lint, and version control workflows cannot run from within the IDE.
Evidence: curl http://127.0.0.1:8080 fails in the OhCode terminal (command not found: curl) but works in HiShell; git and cargo are unavailable in the OhCode terminal.
Proposed fix: Add an HttpAdapter (bridging extension fetch() to @ohos.net.http) and a NativeExecAdapter (reusing host_command_bridge.cpp to let extensions run commands in the HiShell context).
Benefit: OHcode becomes a complete development environment where extensions can connect to localhost services and run build tools without leaving the IDE.

ohcode_feature_request.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions