r/opencode • • 8d ago

Exclude local device/network access

I wish to exclude access to other connected devices on the same network.

According to docs, I simply execute the below line in Terminal? I'm assuming this is broad, right? I mean, this will restrict device connections by any other app/device? Or is this simply to exclude OpenCode from access?

export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
export NO_PROXY=localhost,127.0.0.1,::1
1 Upvotes

5 comments sorted by

2

u/j-cruz_4698 8d ago

Exports apply to processes launched from that shell, not other apps/devices; they route proxy-aware HTTP(S), but don't block LAN access. A firewall can restrict it.

1

u/sasreedit 8d ago

Okay, thanks. Would I then restrict OpenCode to public, blocking private network access?

→ More replies (1)

1

u/Just_Raspberry_645 8d ago edited 8d ago

This is to forward traffic through a proxy, opencode will restrict access to localhost by default unless you use opencode serve

1

u/sasreedit 8d ago

I didn't knowingly do this, yet OC model access my network connected phone.

I wanted to integrate a gate opening app into Home Assistant. I provided the public url if both in session. OC proceeded to, I guess, use my phone's respective app for testing. The issue is it also must have set a hidden proxy as I was unable to gain Internet traffic.