powered by Jive Software

Server to server proxy

I’‘d like to develop a server to server proxy based on the client to server proxy I’‘ve already developed. My client to server proxy uses the fact that in the client you can tell it to use an alternate host to get to the server you’‘re logging in to. In this case I simply specify a local port that my proxy is listening on and everything works. Now what I’'d like to do is somehow tell Openfire to running on s1 to go to localhost:somePort to send information to s2 instead of sending information directly to s2. Any ideas on how to archive this?

Hey edify,

Openfire provides a way to override DNS lookups with custom values. In the jira issue JM-711 you will find how to set the system property dnsutil.dnsOverride.

Regards,

– Gato

Awesome that is GREAT news, thank you very much for the help.

On the System Properties I set

dnsutil.dnsOverride

to

{rcm2.cse.lehigh.edu,localhost:15002}, {basin.cse.lehigh.edu,localhost:15001}

I’'ve initially tried 127.0.0.1 instead of localhost and that caused the following errors in the log (one for each try)

2007.05.31 19:20:28 [org.jivesoftware.wildfire.net.DNSUtil.(DNSUtil.java:48)

at org.jivesoftware.wildfire.server.ServerDialback.validateRemoteDomain(ServerDial back.java:455)

at org.jivesoftware.wildfire.server.ServerDialback.createIncomingSession(ServerDia lback.java:342)

at org.jivesoftware.wildfire.session.IncomingServerSession.createSession(IncomingS erverSession.java:102)

at org.jivesoftware.wildfire.net.ServerSocketReader.createSession(ServerSocketRead er.java:211)

at org.jivesoftware.wildfire.net.SocketReader.createSession(SocketReader.java:391)

at org.jivesoftware.wildfire.net.BlockingReadingMode.run(BlockingReadingMode.java: 53)

at org.jivesoftware.wildfire.net.SocketReader.run(SocketReader.java:120)

at java.lang.Thread.run(Thread.java:595)

My server version is 3.2.3 and I assume because of the error it isn’‘t redirecting the server to server communications. At ideas what I’'m doing wrong? Thank you again for the help.

Hi,

if you click on the JM-711 link you’'ll realize that this issue is not yet implemented but Gato is working on it right now (Status: In Progress). So you may want to wait until it is solved and then fetch the source code via SVN or some hours later a nightly build.

I’'m not sure what code is in the current server, you are still running Wildfire, this could also be a problem.

LG

my interpretation of that page was that the system property override had been implemented, but the in progress bit was a nice addition to the GUI to configure this new system property instead of having to set it manually. Is this interpretation incorrect?

Hi,

this may be indeed the case, but I wonder how good the current code is. Sorry for the confusion about which code is in Wildfire/Openfire.

156             private static Map<String, HostAddress> decode(String encodedValue) {
157              Map<String, HostAddress> answer = new HashMap<String, HostAddress>();
158              StringTokenizer st = new StringTokenizer(encodedValue, "{},:");
159              while (st.hasMoreElements()) {
160                  String key = st.nextToken();
161                  answer.put(key, new HostAddress(st.nextToken(), Integer.parseInt(st.nextToken())));
162              }
163              return answer;
164          }

It seems to work fine for one address but it fails to split the values correctly. So if you specify {a,b,c},{d,e,f} it will detect the space character () as the next key, “d” as the host address and “e” as the port. Removing the space character should solve this issue for you.

LG

so the space character was indeed my issue, thanks a bunch for the help.