Opened 22 months ago

Closed 3 months ago

#2163 closed defect (fixed)

Expose user-agent strings for HTTP proxy in Tunnel Manager configuration

Reported by: Reportage Owned by:
Priority: minor Milestone: 0.9.43
Component: apps/i2ptunnel Version: 0.9.33
Keywords: User Agent, Settings, Tunnel Manager, UX Cc:
Parent Tickets: Sensitive: no

Description

Currently the HTTP client tunnel spoofs the User Agent strings for access inside I2P, and also if using an outproxy, using two preconfigured UA's. Exposing the user agent strings in http client tunnel settings would allow more fine-grained control, which is currently either all or nothing.

It may be useful to provide an alternative spoofed UA, both within I2P and via the outproxy, and allowing the user to optionally configure their own UA would be a win. Webspiders in the I2P network, for example, may wish to advertise their own custom UA out of courtesy, or users may wish to spoof a custom UA (eg. containing a specific OS or browser reference) when using the outproxy in order to improve access/compatibility.

Exposing this in the UI also better informs the user what their browser is advertising while using I2P, and may encourage them to modify the setting when they realise they're running Firefox24(!), effectively declaring I2P usage to well-informed observers.

Subtickets

#2603: Support quoting in i2ptunnel custom options fieldclosed

Change History (9)

comment:1 Changed 22 months ago by zzz

Milestone: 0.9.34undecided
Status: newopen

We do have a control for spoofing on/off. Somebody running a spider should turn it off. Then, your user-agent may be changed by configuring your spider or browser. That seems more flexible than having additional spoof configuration settings.

We're all getting hammered by spiders with a MYOB UA right now and they clearly can't be bothered to even change the checkbox, or don't want to, because they don't want to be blocked. I don't think adding additional configuration complexity would encourage them to use it.

I'm sure you're getting used to this answer from me, but anything that's a non-default feature or option is low priority.

We can certainly bump up the firefox version in the meantime. I suppose we should do better at keeping it reasonably current. Have a suggested replacement string?

comment:2 Changed 22 months ago by zzz

Bumped up to 58 in cb4c0f6e8f2c7bdeb006684666fbafbff4250d71 to be 0.9.33-6

comment:3 Changed 22 months ago by Reportage

I recommend keeping the UA in sync with Tor browser's. Less churn as it's based on the ESR version of Firefox (so less source updates required), and it's easily learnt by querying for general.useragent.override on Tor browser's about:config page.

Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0

Regarding exposing the setting on the http client tunnel edit page, I disagree regarding flexibility. Being able to set the UA globally for all http traffic, either internal or external, is something that's not easily achieved otherwise. Each client has to be configured individually, and for some clients the setting may be unavailable.

Furthermore, configuring separate user agents for internal and external traffic is harder still. Allowing a bespoke UA for either internal traffic, external traffic, or both is something that's most easily achieved by configuring the proxy itself, in this case the http client service.

As for MYOB spiders, enabling unique ips on the http server tunnel is a fairly easy path to selective blocking, given that the spiders seem to be using long-lived dests; courteous users running spiders may still elect to advertise their bot via a tunnel pref if given the opportunity.

This proposal requires very little in terms of implementation: exposing the parameter in the UI and adding a new pref. If it were more complex, I'd be more inclined to agree with the low priority assessment. Sometimes things can be achieved more rapidly than the time it takes to respond to bug reports/enhancement requests, given the inclination!

Last edited 22 months ago by Reportage (previous) (diff)

comment:4 Changed 22 months ago by zzz

re: TBB, that's a good suggestion, I'll change it, thanks.

re: implementation difficulty, speaking generally, any new option in the UI requires:

  • setting the default for the option
  • displaying the option (including CSS and translated strings)
  • handling setting of the option
  • saving changes to the option
  • checking for the option
  • using the option if set, else default
  • testing all the above

The good news is that all the option infrastructure is there for i2ptunnel.
The bad news is there's already an overwhelming number of options on the i2ptunnel edit page.

All that for something less than 1% of users will benefit from. That's why my standard answer to requests for new options is "not easy, low priority".

It's not clear if this is a feature you need, or a feature you're speculating that somebody else might need. If the former, please say that.

comment:5 Changed 22 months ago by zzz

UA changed to TBB one as suggested, in 9cc68dc1020e6a6449869f90bb802fcaaa096970 to be 0.9.33-6

comment:6 Changed 5 months ago by zzz

Sensitive: unset

I coded this up, but sadly, UA strings contain spaces, and we don't support quoting or escaping in the custom options field of the i2ptunnel edit form. That would take some doing, and I'm not going to add separate UI fields for the UA, that would just be more clutter.

The best way to do this continues to be turning on the 'do not spoof user-agent header' option and changing the UA in the crawler software or browser, as described in comment 1.

comment:7 Changed 4 months ago by zzz

I checked in the code in comment 6 late in the 0.9.41-x cycle. As noted there, until we support quoting in the custom options field, it's not too useful. Ticket for that to follow.

comment:8 Changed 4 months ago by zzz

Add a subticket #2603 (Support quoting in i2ptunnel custom options field).

comment:9 Changed 3 months ago by zzz

Milestone: undecided0.9.43
Resolution: fixed
Status: openclosed

Subticket closed in 83d661c93a51be1460496c75a79f84f71d13d9f1 to be 0.9.42-9

Note: See TracTickets for help on using tickets.