Cool, thanks. I don't think that's going to help, but it gets me thinking in a new direction. -- Xpovos
if you don't have ssh (the sshd client) and you're using windows, then you probably want cygwin or putty. in linux, ssh should already be installed. ~a
well if sshd is running on port 22 on B, the command from A is:
"ssh -L localhost:12345:localhost:12345 username@B"
(replace username with your username, replace B with the domain name or ip of B. replace 12345 with the port that the application is expecting)
the command from C is:
"ssh -R localhost:12345:localhost:12345 username@B"
if you aren't worried about security, there are ways of simplifying this. i have included a pretty secure way of handling the situation above (though if you're uber-paranoid like me, there's even more craziness you can do). ~a
a: It may be a lot of wishing in one hand and crapping in the other, but if I can't do it on this server, I -can- do it on others. So the practicality of setting up a proper proxy/port-forward is more important to me than the 'pro-hosted' server aspect. -- Xpovos
xpovos: well you talked about creating a program from scratch ("I want to build a piece of software that will run on a pro-hosted server"). i imagine if you can write your own piece of software to put on B, then you can at the very least install sshd on B. . . . assuming it's not already running: sshd's default port is 22. ~a
a: I don't know about sshd on B. I assume there is a firewall on B, but I don't know any of the settings. Port 80 works, so do the standard FTP ports. So, I can work around it by having the program talk over one of those instead of the default. Easy enough. The question I have now is, how do I tell if B has sshd? -- Xpovos
i'm talking about a more general kind of port forwarding. you can forward a port on B to C (even though C is behind a firewall) very easily if you have sshd running on B. do you have sshd running on B? also, is there any firewall on B? ~a
Alternatively, I could manually set everyone's router settings, but that would require more time and permissions than I have. Also, it doesn't help people who are just using default configurations on password locked wireless boxes that an ISP might provide. -- Xpovos
a: Yeah, behind my firewalls I had to set up port forwarding to get the thing to work. But if there's not software on the server to intercept the data and route it to the correct destination, the port forwarding aspect doesn't matter. -- Xpovos
so, machine A is running closed-source program that is initiating the connection, machine B is your world accessible "server", machine C is running your closed source program that is listening for incoming connections. machine A and machine C are behind a "firewall" that only allows outgoing connections. does that describe your situation correctly? ~a
what you have described is port forwarding. i can explain port forwarding, but i doubt "pro-hosted" (whatever that means) will let you set up port forwarding. on the other hand, you might get some fancy port forwarding to work over a php script (or any language theoretically). ~a
"pro-hosted"? ~a
So my goal is to the program running on a mutually accessable server so that each client software can connect to it, but would think itself connected to the other computer directly. -- Xpovos
New question: I want to build a piece of software that will run on a pro-hosted server and listen to a specific port. The goal is to create a router for a third-party closed source program that can communicate with other versions of itself over that port. Unfortunately the P2P in it is very old and doesn't deal well with things like routers and firewalls. -- Xpovos
a/vinnie: Let me toss some stuff together to show an example, then you can critique my form. The drawbacks of self-taught. -- Xpovos
xpovos: it seems like you could also just make a whole other query for desc sort, if you want to skip the variable. but I think having a variable for asc or desc sort is fine. I've done it before - vinnie
a: In my case, trying to pass the variable through forms. Probably a lot less cumbersome than I think it is. -- Xpovos
i don't understand what is cumbersome about having a variable that decides if you want the list to be sorted ascending or descending (an enum of some sort would work). ~a
i guess i don't understand the question well enough to help any further. ~a
So... that's the best solution? -- Xpovos
right, "order by" my bad. ~a
a: Currently sorted by MySQL in the query "ORDER BY `$` ASC. The solution I have devised involves using another variable to track the ORDER BY term and then reverse the ASC/DESC bit depending on what was previously used. -- Xpovos
i don't understand your last statement: "I can't easily reverse sort without adding an additional variable". but both sql's sorting features and php's sorting features allow for a reverse (descending) sort. sql has "SORT BY blah DESC" (DESC is short for descending). php has rsort, krsort, and arsort. ~a
you're going to have to explain more. in specific, what are you currently using to sort? are you using sql's sorting features, or php's sorting features? ~a
I can create dynamic sorting tables using PHP retrieving data from a MySQL database. But it involves re-querying the DB. Also, I can't easily reverse sort without adding an additional variable, which seems cumbersome. Is this the best way? -- Xpovos