Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 72C47200BF5 for ; Sat, 7 Jan 2017 17:22:32 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7164B160B3C; Sat, 7 Jan 2017 16:22:32 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 91EE1160B2F for ; Sat, 7 Jan 2017 17:22:31 +0100 (CET) Received: (qmail 58488 invoked by uid 500); 7 Jan 2017 16:22:30 -0000 Mailing-List: contact commits-help@guacamole.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@guacamole.incubator.apache.org Delivered-To: mailing list commits@guacamole.incubator.apache.org Received: (qmail 58479 invoked by uid 99); 7 Jan 2017 16:22:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jan 2017 16:22:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 34D2E1849D1 for ; Sat, 7 Jan 2017 16:22:30 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.218 X-Spam-Level: X-Spam-Status: No, score=-6.218 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id TRGHjxDRw72v for ; Sat, 7 Jan 2017 16:22:29 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id B31C05F29A for ; Sat, 7 Jan 2017 16:22:28 +0000 (UTC) Received: (qmail 58091 invoked by uid 99); 7 Jan 2017 16:21:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jan 2017 16:21:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6E1E22C022B for ; Sat, 7 Jan 2017 16:21:58 +0000 (UTC) Date: Sat, 7 Jan 2017 16:21:58 +0000 (UTC) From: "Nick Couchman (JIRA)" To: commits@guacamole.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (GUACAMOLE-47) Get client hostname for use in guac RDP session MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 07 Jan 2017 16:22:32 -0000 [ https://issues.apache.org/jira/browse/GUACAMOLE-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15806405#comment-15806405 ] Nick Couchman edited comment on GUACAMOLE-47 at 1/7/17 4:21 PM: ---------------------------------------------------------------- So, code should be ready for review and to try out - if people think I should submit a pull request, I will, or if you'd rather review in my git repo before that, that's fine by me. I think I messed up one of the contribution guidelines in that I committed to the master branch instead of creating a separate branch, but hopefully that's not a show-stopper. If it is, I'll redo it. Here's the repo URL: https://github.com/necouchman/incubator-guacamole-client To use it, compile and load up the guacamole code. The two new tokens are: - GUAC_REMHOST - GUAC_REMIP If you're connecting to Guacamole directly through Tomcat this should work with no additional configuration, aside from using the tokens in the connection configuration. If you're using a proxy, you'll need to do one of two things: 1) Define the X-Guacamole-Client-Hostname and/or X-Guacamole-Client-IP headers. Here's an example for Apache that uses the REMOTE_HOST and REMOTE_ADDR headers: {code} RequestHeader set X-Guacamole-Client-Hostname %{REMOTE_HOST}s RequestHeader set X-Guacamole-Client-IP %{REMOTE_ADDR}s {code} 2) Configure Tomcat to allow the X-Forwarded-For header to be passed through. This is done with the following configuration in server.xml. Remember this will only ever have the IP address - X-Forwarded-For never has the hostname. {code:xml} {code} Note that you need to set internalProxies to the list of hosts that are proxying to Guacamole. In my case I'm just doing it on the local system, so I have 127.0.0.1. was (Author: nick.couchman@yahoo.com): So, code should be ready for review and to try out - if people think I should submit a pull request, I will, or if you'd rather review in my git repo before that, that's fine by me. I think I messed up one of the contribution guidelines in that I committed to the master branch instead of creating a separate branch, but hopefully that's not a show-stopper. If it is, I'll redo it. Here's the repo URL: https://github.com/necouchman/incubator-guacamole-client To use it, compile and load up the guacamole code. The two new tokens are: - GUAC_REMHOST - GUAC_REMIP If you're connecting to Guacamole directly through Tomcat this should work with no additional configuration, aside from using the tokens in the connection configuration. If you're using a proxy, you'll need to do one of two things: 1) Define the X-Guacamole-Client-Hostname and/or X-Guacamole-Client-IP headers. Here's an example for Apache that uses the REMOTE_HOST and REMOTE_ADDR headers: RequestHeader set X-Guacamole-Client-Hostname %{REMOTE_HOST}s RequestHeader set X-Guacamole-Client-IP %{REMOTE_ADDR}s 2) Configure Tomcat to allow the X-Forwarded-For header to be passed through. This is done with the following configuration in server.xml. Remember this will only ever have the IP address - X-Forwarded-For never has the hostname. Note that you need to set internalProxies to the list of hosts that are proxying to Guacamole. In my case I'm just doing it on the local system, so I have 127.0.0.1. > Get client hostname for use in guac RDP session > ----------------------------------------------- > > Key: GUACAMOLE-47 > URL: https://issues.apache.org/jira/browse/GUACAMOLE-47 > Project: Guacamole > Issue Type: New Feature > Components: guacamole-client > Affects Versions: 0.9.9 > Reporter: Zach Bonjour > Priority: Minor > > The "Clientname" variable should show the client name connected to the Apache server. I am not a programmer, but if I am understanding this right, there is a java servlet that could gather that information so it can be used in the Guacamole session. > http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getRemoteHost() > Is this possible? -- This message was sent by Atlassian JIRA (v6.3.4#6332)