If you wish to connect your app server to localhost, you need to forward your tcp requests to CCS server.
I use stunnel in client mode here.
Every time my app server binds to localhost, stunnel binds to ccs and acts as a TCP proxy.
I hope this is what you mean by "connect from localhost".