Skip to content

Should we add proxy argument in the client...? #299

@YooSunYoung

Description

@YooSunYoung

Problem

I was testing the scitacean interface with local instance.
It worked just fine at the office.
And then I came home and continued working on it then I got ConnectError...

Environment

  • My local laptop (mac)
  • Local instance of scicat (from ScicatLive)
    • Connecting to the staging scicat backend wasn't a problem. It also raised an error when the proxy was set http://localhost manually.

Trouble Shooting Attempts

All the arguments looked fine and when I tried the api with curl it worked fine.

Then I tried hard-coding proxy to be http://localhost in the code block below and it worked...!

And then I removed the hard-coded line and connected to ess VPN and then now it works again.

return httpx.request(
method=cmd,
url=url,
content=data.model_dump_json(exclude_none=True)
if data is not None
else None,
params=params,
headers=headers,
timeout=self._timeout.seconds,
)

Hardcode-fix:

  return httpx.request(
      method=cmd,
      url=url,
      content=data.model_dump_json(exclude_none=True)
      if data is not None
      else None,
      params=params,
      headers=headers,
      timeout=self._timeout.seconds,
      proxy="http://localhost"
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions