golemfactory / yapapi

Python high-level API for Golem.
https://yapapi.readthedocs.io/en/stable/
GNU Lesser General Public License v3.0
49 stars 24 forks source link

Allow SocketProxy local address to be overwritten #1132

Closed cryptobench closed 1 year ago

cryptobench commented 1 year ago

In showcase we want to expose the service running via SocketProxy, but currently this is not possible because it's bound to 127.0.0.1 instead of 0.0.0.0

We would like an update for Yapapi that allows us to overwrite this address.

Reference: https://github.com/golemfactory/yapapi/blob/3573e7f8cab900287bc1d37ca9837cdbcaceea93/yapapi/contrib/service/socket_proxy.py#L28

grisha87 commented 1 year ago

@shadeofblue , @jalas167 - This one falls into "Urgent & Important" for us, but we don't have a possibility to set the priority on yapapi issues.

shadeofblue commented 1 year ago

uh, when one instantiates the proxy, one can supply another address in the constructor, like this:

        proxy = SocketProxy(address="1.2.3.4", ports=[8484])

so I'm unsure what the point of this issue is...

cryptobench commented 1 year ago

Must be a misunderstanding from my end then.

https://docs.python.org/3.12/library/typing.html#typing.Final

A special typing construct to indicate to type checkers that a name cannot be re-assigned or overridden in a subclass.

I understood that as if we weren't able to change it.

shadeofblue commented 1 year ago

@cryptobench yeah, you're not supposed to change the constant, just use the provided argument on the SocketProxy class