Getting remote address in applet

hi guys,
how to get client ip in an applet.i tried lot with each n every
possible combination
but it always gives u Localhost/127.0.0.1.
first i tried with this line of code...
clientIP=InetAddress.getLocalHost().getHostAddress();
then i tried with this one........
String hostname = InetAddress.getLocalHost().getHostName();
System.out.println(hostname);
InetAddress[] ads = InetAddress.getAllByName(hostname);
for (int i=0; i<ads.length; i++) {
     System.out.println(ads);          
then i tried with javascript calling applet function in javascritp
but all in vain.
why is it so. is there any security problem in applet.
or what?? or where i m worng??
anyone know how to get client ip.
it will be greatfull if any of u cud tell me the solution.
thankx in advance
capri

check out this post:
http://64.4.16.250/cgi-bin/linkrd?_lang=EN&lah=163bc05ac79dc3757acf72e4b5735cfc&lat=1046999833&hm___action=http%3a%2f%2fforum%2ejava%2esun%2ecom%2fthread%2ejsp%3fforum%3d421%26thread%3d357931
Eric

Similar Messages

  • Get remote address in HttpSessionAttributeListener?

    Hi,
    I'm using an HttpSessionAttributeListener to log user sessions: it looks for the "NtlmHttpAuth" attribute, which is bound by the NtlmHttpFilter from the jCIFS project.
    Is there a way to get the remote user address, from the HttpSession? I can't seem to find an obvious way to do it. The only thing that comes to mind is to create another filter (executed before NtlmHttpFilter) that would grab it from the request and set it as an attribute on the session, but this seems a little circuitous. I'm not even sure it would work, since I'm not 100% clear on how exactly NtlmHttpFilter interacts with the session life-cycle.
    What's the right thing to do?

    The remote address is indeed request based, not session based.

  • Problem in getting remote address?

    Hi,
    I have a procedure on my login page, which reads user's IP address and stores it in a log file. I am using the following statement to get the IP address of remote user:
    select owa_util.get_cgi_env('REMOTE_ADDR') from dual;
    It is running fine on my workspace at http://apex.oracle.com and returns the real IP address of the remote user. But when I use the same code at my hosted server I get 127.0.0.1 instead of real IP.
    Any ideas please?
    Thanks,
    Zahid

    Hello,
    >
    Can you please explain that how it can be misleading and how would you go for securing anything super confidential etc.?
    >
    Well, lots of reasons really. Firstly the IP address that you think identifies an end user might in fact be the IP address of a transparent proxy server that their ISP uses (a transparent proxy server can modify the request headers to change the IP address so that the request appears to come from them rather than the end user). The user might also have actively used a proxy server to 'appear' to be coming from somewhere else (a common technique to view content that should not be visible outside certain countries etc).
    The user might be inside a corporate LAN which presents a single (or multiple) NAT IP address to the world, so you only know the IP address of their main NAT routers/switches etc.
    The user might be using a tunneled SSH session so that the traffic appears to be coming from another bastion host rather than their own machine.
    The user might be using a network like TOR, so that their network traffic appears to be coming from elsewhere.
    Pretty much since TCP/IP became popular there have been ways and means to spoof your IP address (for various nefarious reasons), it's always been relatively easy to spoof a fake IP address at the packet level...obviously the difficult bit is to then receive the content if you're pretending to be elsewhere ;) How it has and continues to be done...
    Those are just a few examples off the top of my head, there are others...
    My point is, that using the IP address of the HTTP request can be useful, however just be aware that the address might not be the actual real address of the real end user (for the reasons described). I have actually seen people block a particular IP address from access a web site, only to find that it was actually the address of a proxy server used by hundreds (or more likely thousands) of other users who had also been inadvertently blocked from accessing the site.
    Hope this helps,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • Please help: Get IP address of a remote device (wifi kit) from DHCP router

    Hi ppl,
    I am about to get the IP address for the wifi kit which is connected to the same router with my PC.
    I need to control my wifi kit through TCP client communication, but DHCP tends to assign new IP address to my wifi kit when connected to router.
    Hence, i wish to write a java function to trace the IP address before starts the communication.
    I am thinking to get the wifi kit's IP address based on the Hostname (name of the wifi shield):
    As below:
    InetAddress thatIp = InetAddress.getByName("Wiznet");
    System.out.println("IP E:"+thatIp.getHostAddress());
    But i don't think this is secure..
    I attempt to research for getting IP address with MAC..
    But have ambiguity on the result i found.
    It stating i have to get the ARP table from router but it is not a good approach.
    I have no luck for next finding on how retrieving the table with Java.
    Hereby hope to have your advise how can i get the ip address of my wifi kit in a more dynamic and secure method..
    is it using Hostname or MAC address or else...
    many thanks.

    hi... wish to have your advise again.
    I tried to retrieve the arp table in java and attempt to extract the IP address based on MAC address for particular devise.
    But i stuck with the substring... my code is as below:
    Process result = Runtime.getRuntime().exec("arp -a");
         BufferedReader output = new BufferedReader
                   (new InputStreamReader(result.getInputStream()));
         String line = output.readLine();
         while(line != null){
              if ( line.startsWith("default") == true ){
                   System.out.println("is default");
                   break;
         line = output.readLine();
         String ipAdd = line.substring(0, 18);
         String MACAdd = line.substring(24, 42);
         System.out.println(line.length() + " " + line + " " + ipAdd + " " + MACAdd );
    i m trying to sub the IP and MAC accordingly.. but i got error saying
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 42
         at java.lang.String.substring(Unknown Source)
         at ExecTest.main(ExecTest.java:22)
    i dun understand this! as since the length of LINE is 56 , why STRING INDEX OUT OF RANGE happen?!
    please advise!!!

  • GlassFish, JAAS Login Module - get remote ejb clien IP address

    How to get remote ejb client IP in my custom JAAS login module if I use Glassfish?
    Edited by: NoName on Sep 23, 2009 4:06 AM

    Hi,
    Try configuring wdisp/add_xforwardedfor_header in web dispatcher as described here:
    http://help.sap.com/saphelp_nw04/helpdata/en/de/89023c59698908e10000000a11402f/content.htm
    And configuring ClientIpHeaderName on the java server as described here:
    http://help.sap.com/saphelp_nw04/helpdata/en/52/46f6a089754e3a964a5d932eb9db8b/content.htm
    Regards,
    Maria

  • How to get Plant address from SAP R/3 to SRM

    Hi Gurus,
    We need to retrieve the plant address from SAP R/3 to SRM and display it in the output list of the report (SRM).
    Suggest any standard FM or should we need to create a Custom Remote enabled FM and put the select query to get the address.
    Regards
    Paul

    Hi Paul,
    Try using the RFC_READ_TABLE function module...
    Pass the table name as t001w which contains the plant details.
    Hope this helps.
    Thanks,
    Pradeep

  • Coherence::net::messaging::ConnectionException: could not establish a connection to one of the following addresses: {10.242.152.242/10.242.152.242:8088}; make sure the "remote-addresses" configuration element contains an address and port of a running TcpA

    Hi
    I have installed coheI have installed coherence server "fmw_12.1.3.0.0_coherence_Disk1_1of1.zip" along with Examples on windows machine and C++ client coherence-cpp-12.1.3.0.0b51709-windows-x86-vs2012.zip on the same machine.
    I have built the "contacts" C++ Example successfully and while I execute this "contacts" using run I am facing TcpAcceptor error.
    On my coherence server the TcpAcceptor is listening on port 8088, so I have modified the extend-cache-config.xml file with values "ip address of my windows machine" and port as "8088".
    All the time I am getting below error,
    coherence::net::messaging::ConnectionException: could not establish a connection to one of the following addresses: {10.242.152.242/10.242.152.242:8088}; make sure the "remote-addresses" configuration element contains an address and port of a running TcpAcceptor
        at class coherence::lang::TypedHandle<class coherence::component::net::extend::PofConnection> __thiscall coherence::component::util::TcpInitiator::openConne
    ction(void)(TcpInitiator.cpp:307)
        at coherence::component::util::TcpInitiator::openConnection
        at coherence::component::util::Initiator::ensureConnection
        at coherence::component::net::extend::RemoteCacheService::openChannel
        at coherence::component::net::extend::RemoteService::doStart
        at coherence::component::net::extend::RemoteService::start
        at coherence::component::util::SafeService::startService
        at coherence::component::util::SafeService::restartService
        at coherence::component::util::SafeService::ensureRunningServiceInternal
        at coherence::component::util::SafeService::start
        at coherence::net::DefaultConfigurableCacheFactory::configureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureRemoteCache
        at coherence::net::DefaultConfigurableCacheFactory::configureCache
        at coherence::net::DefaultConfigurableCacheFactory::ensureCache
        at coherence::net::CacheFactory::getCache
        at unsigned __int64 coherence::lang::class_spec<class coherence::lang::Managed<class ContactId>,class coherence::lang::extends<class coherence::lang::Object,class coherence::lang::Void<class coherence::lang::Object> >,class coherence::lang::implements<void,void,void,void,void,void,void,void,void,void,void,void,void,void,void,void> >::sizeOf(bool)
        at _onexit
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at BaseThreadInitThunk
        at RtlInitializeExceptionChain
        at RtlInitializeExceptionChain
        on thread "main"
    Caused by: coherence::net::messaging::ConnectionException: coherence::component::util::TcpInitiator::TcpConnection@029EAD78{Id=NULL, Open=1, LocalAddress=NULL,
    RemoteAddress=10.242.152.242/10.242.152.242:8088}: socket disconnect
        at class coherence::lang::TypedHandle<class coherence::net::messaging::Response> __thiscall coherence::component::net::extend::AbstractPofRequest::Status::g
    etResponse(void)(AbstractPofRequest.cpp:203)
        at coherence::component::net::extend::AbstractPofRequest::Status::getResponse
        at coherence::component::net::extend::AbstractPofRequest::Status::waitForResponse
        at coherence::component::util::Initiator::openConnection
        at coherence::component::net::extend::PofConnection::open
        at coherence::component::util::TcpInitiator::openConnection
        at coherence::component::util::Initiator::ensureConnection
        at coherence::component::net::extend::RemoteCacheService::openChannel
        at coherence::component::net::extend::RemoteService::doStart
        at coherence::component::net::extend::RemoteService::start
        at coherence::component::util::SafeService::startService
        at coherence::component::util::SafeService::restartService
        at coherence::component::util::SafeService::ensureRunningServiceInternal
        at coherence::component::util::SafeService::start
        at coherence::net::DefaultConfigurableCacheFactory::configureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureService
        at coherence::net::DefaultConfigurableCacheFactory::ensureRemoteCache
        at coherence::net::DefaultConfigurableCacheFactory::configureCache
        at coherence::net::DefaultConfigurableCacheFactory::ensureCache
        at coherence::net::CacheFactory::getCache
        at unsigned __int64 coherence::lang::class_spec<class coherence::lang::Managed<class ContactId>,class coherence::lang::extends<class coherence::lang::Object
    ,class coherence::lang::Void<class coherence::lang::Object> >,class coherence::lang::implements<void,void,void,void,void,void,void,void,void,void,void,void,void
    ,void,void,void> >::sizeOf(bool)
        at _onexit
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at class coherence::util::Hashtable * coherence::lang::factory<class coherence::util::Hashtable>::create(void)
        at BaseThreadInitThunk
        at RtlInitializeExceptionChain
        at RtlInitializeExceptionChain
        on thread "main"
    Caused by: coherence::io::IOException: socket disconnect
        at unsigned int __thiscall coherence::net::Socket::readInternal(unsigned char *,unsigned int)(Socket.cpp:333)
        at coherence::net::Socket::readInternal
        at coherence::net::Socket::SocketInput::read
        at coherence::io::BufferedInputStream::fillBuffer
        at coherence::io::BufferedInputStream::read
        at coherence::component::util::TcpInitiator::readMessageLength
        at coherence::component::util::TcpInitiator::TcpConnection::TcpReader::onNotify
        at coherence::component::util::Daemon::run
        at coherence::lang::Thread::run
        on thread "ExtendTcpCacheService:coherence::component::util::TcpInitiator:coherence::component::util::TcpInitiator::TcpConnection::TcpReader"

    We are facing same issue.    Could you please provide us any working .Net sample code for the version 12.1.2.0.
    <ssl>
                  <protocol>Tls</protocol>
                  <local-certificates>
                    <certificate>
                      <url>c:\Cert\</url>
                      <password>password</password>
                      <flags>DefaultKeySet</flags>
                    </certificate>
                  </local-certificates>
                </ssl>
    thanks
    Bala

  • Problem in connecting remote server using Applet?

    Hello everybody,
    I am facing problem in connecting to remote server using Applet in browser. I am using JDK 1.5.0_12 and running the application on apache 2.2.
    Firstly I have tried with simple jar file which could not connect to remote server and throws permission denied than now I am trying with signed jar file but also not working. I have changed the java.policy file of JDK in server with grant all Permission but also it throws "java.security.AccessControlException:access denied(java.net.SocketPermission 127.0.0.1:1521 connect, resolve)".
    Can anybody suggest me how to solve this problem?
    Thank You.
    -Ritesh

    >
    I am facing problem in connecting to remote server using Applet in browser.
    Firstly I have tried with simple jar file which could not connect to remote server and throws permission denied than now I am trying with signed jar file but also not working. >Were you prompted to accept the digitally signed code? To see what I mean, check out the [Defensive loading of trusted applets demo|http://pscode.org/test/docload/]. If you are not getting the prompt, or refused it, follow the link to sandbox.html for tips on how to proceed.

  • VWLC clients getting DHCP address from management VLAN

    Hi,
    We have a strange scenario whereby some wireless employees are obtaining addresses from the management VLAN.
    Some details:
    DHCP managed by MS DHCP 2008 R2 (in remote data centre)
    Cisco vWLC AIR-CTVM-K9 running v7.6.110.0
    AP's are a mix of 2602 and 3702 (46 and 2 of each respectively)
    SSID's are employee, guest, and production devices (all mapped to their own interface with relevant VLAN tag as per normal)
    AP's all in FlexConnect mode as per vWLC caveats
    Some employees are receiving addresses in the wireless management VLAN. This network only has six DHCP addresses available as it is solely for AP's, WLC and HSRP gateway. Obviously this gets exhausted very quickly leaving us with a scenario where clients are not obtaining DHCP addresses.
    I understand that with FlexConnect mode, it will assign IP's from the native VLAN. What I don't understand is why most clients receive addresses in the correct VLAN, but a handful do not, and then cannot get an address from DHCP. Obviously the ideal scenario would be to put the AP's into local mode but unless this has changed in a SW release then I don't believe it's possible...
    My question is: How do I get ALL the employees to obtain addresses from their interface and not the management VLAN?
    Thanks in advance.

    Hi,
    I think we need a closer look to your configurarion to eliminate some possibilities:
    - What is the WLAN security you choose?
    - What is the interface that is configured under the WLAN?
    - Does your WLAN have local switching enabled?
    - If your security is using RADIUS server, do you have AAA override enabled under the WLAN config?
    - If your security is using RADIUS server, do you send any attributes to the users?
    - You have eliminate that clients that got management vlan IPs are always on same AP or they can be on any AP.
    HTH
    Amjad

  • How to get MAC Address from device?

    Does any one knows, how we can get programmatically the MAC address of Blackberry device?
    Is it possible to get it through BES IT Policy?
    - Thanks

    abel wrote:
    Yeah that is only working for local system, but how to get remote system's MAC ..?
    Thanks for quick reply ...
    Edited by: abel on Jan 28, 2009 12:10 AMIt is my understanding that only one person ever found the holy grail which you seek. But sadly [_he's dead_|http://forums.sun.com/profile.jspa?userID=649366]
    As a curious aside how did you manage to get the list of IPs?

  • How to get MAC address from IP address in LAN

    Hi all,
    How to get MAC address from IP address in LAN (windows or any OS), I would have all IP addresses of my LAN, so I would like to know all MAC address.
    Code examples are highly appreciated.
    Thanks & Regards,
    abel...

    abel wrote:
    Yeah that is only working for local system, but how to get remote system's MAC ..?
    Thanks for quick reply ...
    Edited by: abel on Jan 28, 2009 12:10 AMIt is my understanding that only one person ever found the holy grail which you seek. But sadly [_he's dead_|http://forums.sun.com/profile.jspa?userID=649366]
    As a curious aside how did you manage to get the list of IPs?

  • Ip remote address invalid

    Hey Guys, trying to connect with a friend of mine for the first time today, neither of us has used iChat before. He is on Leopard, i'm on Tiger.
    We can text no problem, but we can't video or audio chat.
    Keep getting the message IP Remote Address Invalid.
    We tried the usual, logging off etc, even reverted to our mobile broadband sticks & still no-go.
    Any ideas????

    OK so heres the thing, he has a macbook & an iMac - both new, both running leopard, & he can connect those via, text, vid & audio
    But he cant connect to me, running Tiger, so it appears the fault is with me.
    My router is a Thompson 735BB6
    I'm on version 3.1.9 (v446)

  • OWSM Custom Step - Determine Remote Address

    I'm working on a custom step that provides custom metrics for some of our web services (BPEL). The only thing that I haven't been able to figure out is the remote address.
    The heart of my code is:
    public IResult execute(IMessageContext messageContext) throws Fault {
    Result result = new Result();
    result.setStatus(IResult.FAILED);
    boolean isRequest = (IMessageContext.STAGE_REQUEST.equals(messageContext.getProcessingStage()) || IMessageContext.STAGE_PREREQUEST.equals(messageContext.getProcessingStage()));
    if (!isRequest) {
    result.setStatus(IResult.SUCCEEDED);
    return result;
    try {
    log(messageContext);
    result.setStatus(IResult.SUCCEEDED);
    } catch (Exception ex) {
    messageContext.getInvocationStatus().setErrorMessage(ex.getMessage());
    generateFault(ex.getMessage());
    return result;
    private void log(IMessageContext messageContext) throws Exception {
    String client = null;
    try {
    client = ((MessageContext) messageContext).getRemoteAddr();
    // HttpServletRequest httpServletRequest = (HttpServletRequest) messageContext.getProperty("javax.servlet.request");
    // if (httpServletRequest != null) {
    // client = httpServletRequest.getHeader("Host");
    } catch (Exception ex) {
    String msg = "Unable to extract the client IP address.";
    throw new Exception (msg);
    <continue capturing metrics and log to the database>
    The problem is, client is always null. I've tried both techniques I've found online and neither of them seem to produce any results. Could there be some server configuration that is preventing this information from be sent to OWSM?

    mrmora,
    After opening a Service Request and communicating with one of Oracle's reps, I was told that the HttpServletRequest (and I guess other client info) is never available for either the Server Agent or Client Agent.
    I created a Gateway, instead, and and I'm now getting the HttpServletRequest and the client's IP. Both of these codes now work:
    HttpServletRequest request = (HttpServletRequest)messageContext.getProperty("javax.servlet.request");
    String clientIP = httpSrvltRqst.getRemoteHost();
    =====
    String clientIP = ((MessageContext)messageContext).getRemoteAddr();
    Thanks.

  • Is it possible to get Remote Desktop to work from my Surface 2 to a local PC running Vista?

    Is it possible to get Remote Desktop to work from my Surface 2 to a local PC running Vista?
    I keep getting "cannot find PC" entering IP or PC name
    but as a test I have set up my PC to do web hosting, and I can browse to the IP address using desktop IE and see my local web pages.
    I've just found a reference that says it has to be Business Vista.
    Why would Microsoft put such a STUPID restriction in?
    I think this Surface thing is going to go back if so.
    What about Win8 64 Pro? Will that work?

    Hi,
    Thank you for posting in Windows Server Forum.
    Yeah, windows 8 pro can connect to surface 2. There is detailed article guide for it, please check below link.
    Your Complete Guide to Using Remote Desktop on the Microsoft Surface and Windows 8
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Login "async" Remote Address

    Hi,
    we have ACS 5.3 and I don't know why we have a lot of authentication failed of of Username like:
    "state to down"
    "d state to up"
    "% Authentication failed"
    "l1/0:15, changed state to up"
    All logs have "async" in the Remote Address field
    The followng is an example of the log:
    Do you know why?
    thank you
    Fabrizio

    can you please tell me what device they are coming from? The async port is a console port. Once you find the NAS ip address,please get it physically checked what is connected on Console port, even if we have a console cable connected remove it. It seems like there is something that is causing a noise on console port (tty0).
    On the NAS device, please use "show line" and check if there is noise appearing on the console port.
    Jatin Katyal
    - Do rate helpful posts -

Maybe you are looking for

  • DW on SAP business one

    Dear Experts, We are looking for DW option on Business one data for reporting. As I am new to this can you please suggest the best approach. Also is there any Rapid deployment Solution(RDS) for this? Thanks in advance.

  • How do I find itunes for 64 bit windows?

    Where do I find itunes 10 64 bit for windows?

  • Do I need a headphone amp?

    Hello, I have decided to purchase a pair of Sennheiser HD 650s and am wondering whether or not I will need to also purchase a headphone amplifier to use with them. I will be jacking in to my new MacBook Pro directly. Is the DAC in these laptops stron

  • Config XDB for https ssl access

    Hello, I'm trying to configure an Oracle DB 11g for https access. I tried to set the port to 8089 and the protocol to tcps. When I execute the following lines of code, I always get an Error, that the xml-file is not ok. But when validate the output o

  • Not enough memory to install more here maps (but I...

    I have an annoying issue with my new Lumia 925. I extra bought the 32gb version to have plenty enough space for all the maps. (I stored the whole world on "Nokia Karten" on my old symbian N8) But now when I want to install more Maps it tells me that