python client over non-standard port

Asked by Matthew Holder

Is it possible to use a port other than 80 for the client to access data from the server.

Use case:

I create an SSH tunnel for testing purposes to my laptop at home (port 8080) from a PC at work (port 80). I can therefore access the server from home. I tried to add the following to the site.cfg as my XmdsUrl

http://localhost:8080

After doing this, the client was not able to register with the server.
I have done this before using the .NET client and it worked successfully.

Now that I have forwarded to port 80 the python client works. This is not idea however as root access is needed to forward port 80.

Cheers, Matt

Question information

Language:
English Edit question
Status:
Solved
For:
Xibo Edit question
Assignee:
No assignee Edit question
Solved by:
Matthew Holder
Solved:
Last query:
Last reply:
Revision history for this message
Alex Harrington (alexharrington) said :
#1

The problem is that the python client follows the WSDL specification
better than the .net one does.

If you call http://localhost:8080 in your browser then you should see
that at the bottom the WSDL lists the connection to the server as
http://localhost.

That's because the server has no idea that the port is being redirected.

The client will then try and connect on port 80 as it has been
instructed.

If however your server was actually listening on port 8080 as well, and
your redirected port hit port 8080 of the server then it should work
fine.

Alex

This email carries a disclaimer, a copy of which may be read at http://learning.longhill.org.uk/disclaimer

Revision history for this message
Matthew Holder (matt-mattmole) said :
#2

Hi Alex,

Many thanks! I shall amend my apache config.

Matt

Revision history for this message
Matthew Holder (matt-mattmole) said :
#3

OK.

I have set apache to listen on port 8080 on the machine hosting the server, this has IP 1.2.3.4
Machine 1.2.3.40 is visible to the outside world on IP 10.20.30.40

On my laptop I have set the following port forward:

ssh 10.20.30.40 -L 8080:1.2.3.4:80

I can now access the server from my webbrowser on http://localhost:8080

Port 8080 is open on 1.2.3.4 and I have validated this by doing a portscan from 10.20.30.40 (internal IP 1.2.3.40)

I hope my setup explanation makes it easy for you to see what I am trying.

Matt

Revision history for this message
Matthew Holder (matt-mattmole) said :
#4

DOH, it helps to send you the output from the client

<Fault WSDL: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:8080/testing/xibo-server/xmds.php?wsdl' : failed to load external entity "http://localhost:8080/testing/xibo-server/xmds.php?wsdl"
>
<Fault WSDL: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:8080/testing/xibo-server/xmds.php?wsdl' : failed to load external entity "http://localhost:8080/testing/xibo-server/xmds.php?wsdl"
>
<Fault WSDL: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:8080/testing/xibo-server/xmds.php?wsdl' : failed to load external entity "http://localhost:8080/testing/xibo-server/xmds.php?wsdl"
>
matt@pantalaimon:~/Desktop/xibo/client/python$ ./run.sh
Xibo Client v1.2.0a2
Reading default configuration
Reading user configuration
Log Level is: 0
Logging will be handled by: XiboLogXmds
Switching to new logger
Exception in thread Thread-2 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
  File "XiboClient.py", line 3024, in run
  File "XiboClient.py", line 3183, in frameHandle
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'Empty'
Unhandled exception in thread started by
Error in sys.excepthook:

Original exception was:

Revision history for this message
Alex Harrington (alexharrington) said :
#5

Doesn't that still mean that the traffic hits the webserver on port 80? It needs to be 8080 at every stage.

Alex

This email carries a disclaimer, a copy of which may be read at http://learning.longhill.org.uk/disclaimer

Revision history for this message
Matthew Holder (matt-mattmole) said :
#6

Doh,

Thanks Alex. I'd missed 80->8080 in the port tunnel.

Matt