Set Proxy in BlitzGateway

Hi Omer-py users,

I would like to connect to OMERO.server using the BiltzGateway API from a cluster. The connection needs to goes through a proxy. Is there a way to set up a proxy when I defined the connection. Something like:

conn = BlitzGateway(“username”, “password”, host=“localhost”, port=4064, poxy="")


Hi @georgefzakinih

There is no such constructor.

OMERO server now support websockets so that could be a way to access the server.

This is the approach we have taken when for example running notebooks on e.g. CalculateSharpnessOneImage.ipynb


Thanks @j.burel

The setup I have on the HPC cluster is that the compute node would reach out the OMERO.server thought another proxy server. Therefore I need to somehow tell the API the ip of the the proxy server. In REST API (e.g., curl) for example, there is a special argument to specify the proxy ip.

I am not familiar with web sockets. Is there a way we can use them to redirect the traffic to a proxy server?

Thanks and regards,

What type of proxy do you have in place? Would a SOCKS proxy be an option?

Hi @joshmoore ,

The proxy on the HPC compute nodes allow http/s, ftp, and rsync protocols.

Http/s proxy is configured to run on 80, 443, and 8080 ports.

Does that answer your question?

Best regards,

Hi George, it does but it means that SOCKS isn’t supported. We’ve not tried to use websockets via a proxy, but it’s conceivable that it would work:

Those properties can be passed to omero.client like this:

client = omero.client([f"{ip}", "--omero.user=USERNAME", "--omero.pass=PASSWORD", "--Ice.HTTPProxyHost="])

Thanks @joshmoore, that worked. Here is the complete code snippet is somebody is interested

from omero import client
client = client([f"<omero-server-host>", "--omero.port=<omero-server-port>", "--omero.user=<username>", "--omero.pass=<password>", "--Ice.HTTPProxyHost=<porxy-host>", "--Ice.HTTPProxyPort=<proxy-port>"])
print("session created")
conn = BlitzGateway(client_obj=client)
for image in conn.getObjects("Image", "<image-id>"):

Best regards,

1 Like


Rekindling this discussion to ask if it’s possible to user the omero java client to connect via a proxy?

All the best

1 Like

Hi @oburri,

In Java, you can use the same Ice.HTTPProxyHost and Ice.HTTPProxyHostPort arguments by passing them to the String[] constructor for `LoginCredentials

These are passed to the omero.client constructor as in the Python example above:



Dear Josh,

Thanks for the information. It is possible to do this via OMERO.Insight?
I tried

C:\OMERO.insight>OMERO.insight.exe --Ice.HTTPProxyHost=PROXY --I

But to no avail. Is there another way?



Dear @oburri
Unfortunately it will not work using insight,
insight does not handle such use case.
We will need to adjust the way insight is launched to read an ice.config file where such values will be added.

If you need to retrieve data using the Proxy, it will have to be done via a script at the moment


1 Like

Thanks so much for the information.

If you ever decide to go through the points you mention above, we would be most grateful. In the meantime we will work via scripts
All the best