문제

I recently started a single gear application, python 2.7 on Openshift.

I am not being allowed to open a socket -

The Terminal Returned with:

File "server.py", line 21, in <module>
    server_socket.bind(("0.0.0.0", PORT))
  File "/opt/rh/python27/root/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 13] Permission denied

I just need a small socket up and running - does anyone know how I can open a socket on their hosting? If not, what is a good alternative solution so that I can host and open my own python sockets?

도움이 되었습니까?

해결책

you need to bind to your gear's ip address, which on python cartridge i believe is OPENSHIFT_PYTHON_IP, you can't bind to 0.0.0.0, also, only applications bound to port 8080 can be accessed from outside of openshift. (ports 80,443,8000,8443 are all routed to port 8080 on your gear)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top