Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to create proxies outside of the GUI? #159

Closed
Sechorda opened this issue Oct 15, 2024 · 23 comments
Closed

Is there any way to create proxies outside of the GUI? #159

Sechorda opened this issue Oct 15, 2024 · 23 comments
Labels
area: import Import related issues general help General Help queries

Comments

@Sechorda
Copy link

Are there any editable config files outside of the GUI to create a proxy?

Thank you!

@erosman
Copy link
Collaborator

erosman commented Oct 15, 2024

Few options:

  • Export the current preferences and then edit the JSON, (e.g. add/remove proxies) and then import the preferences
  • Use Import -> Import Proxy List

@erosman erosman added general help General Help queries area: import Import related issues labels Oct 15, 2024
@Sechorda
Copy link
Author

Sechorda commented Oct 15, 2024

Few options:

  • Export the current preferences and then edit the JSON, (e.g. add/remove proxies) and then import the preferences
  • Use Import -> Import Proxy List

Thank you for responding.

Can I edit the JSON directly somewhere?

Can I import via CLI or via script?

@erosman
Copy link
Collaborator

erosman commented Oct 16, 2024

Can I edit the JSON directly somewhere?

You can use any text editor

Can I import via CLI or via script?

There is no direct CLI support to extensions.

You can use Enterprise Policy (or managed storage) and those can be edited via CLI or script.

@Sechorda
Copy link
Author

Can I edit the JSON directly somewhere?

You can use any text editor

Can I import via CLI or via script?

There is no direct CLI support to extensions.

You can use Enterprise Policy (or managed storage) and those can be edited via CLI or script.

LIFE SAVER

@Sechorda Sechorda reopened this Oct 16, 2024
@Sechorda
Copy link
Author

I am attempting to apply the policy but am not getting the desired proxy in the menu

what am I doing wrong?

"3rdparty": {
      "Extensions": {
        "[email protected]": {
          "mode": "enable",
          "data": [
            {
              "title": "Caido",
              "type": 1,
              "color": "#66cc66",
              "address": "127.0.0.1",
              "port": 8080,
              "active": true

@erosman
Copy link
Collaborator

erosman commented Oct 16, 2024

"mode": "enable",

There is no such mode. An example of the mode would be:

"mode": "127.0.0.1:8080",
  • Make a set up in FoxyProxy
  • Export the preferences
  • Examine the JSON
  • Enterprise policy uses a similar format

Please note that if you use an Enterprise Policy, you wont be able to change anything from the FoxyProxy UI anymore. Everything will be set from the Enterprise Policy.

@Sechorda
Copy link
Author

"mode": "enable",

There is no such mode. An example of the mode would be:

"mode": "127.0.0.1:8080",
  • Make a set up in FoxyProxy
  • Export the preferences
  • Examine the JSON
  • Enterprise policy uses a similar format

Please note that if you use an Enterprise Policy, you wont be able to change anything from the FoxyProxy UI anymore. Everything will be set from the Enterprise Policy.

this didn't work for me

"3rdparty": {
      "Extensions": {
        "[email protected]": {
          "mode": "127.0.0.1:8080",
          "data": [
            {
              "title": "Caido",
              "color": "#66cc66",
              "active": true

@erosman
Copy link
Collaborator

erosman commented Oct 17, 2024

this didn't work for me

There can be many reasons e.g. error in the the JSON, location, etc
Are you using Chrome or Firefox?
Does the policy show in the browser policies?
The JSON in your post is incomplete.

The included Help should have all the necessary information to set it up.

@Sechorda
Copy link
Author

this didn't work for me

There can be many reasons e.g. error in the the JSON, location, etc Are you using Chrome or Firefox? Does the policy show in the browser policies? The JSON in your post is incomplete.

The included Help should have all the necessary information to set it up.

This is one of the last policies I need to set up and worry about for my OS build.
In the DOCs, I see this which is not very understandable
"mode": "disable", // mandatory: current option, necessary to enable

how do I enable 'mode:'? this is only a snippet of my policies.json, and it does appear in about:policies.

can you please provide the JSON object for me to try? I can't understand the docs. Even in the example it shows 'pattern' in the 'mode:' key:

{
  "policies": {
    "3rdparty": {
      "Extensions": {
        "[email protected]": {
          "mode": "pattern",
          "data": []
        }
      }
    }
  }
}

@erosman
Copy link
Collaborator

erosman commented Oct 17, 2024

how do I enable 'mode:'?

By setting the correct value which can be "pattern", proxy/port, or URL.
See #159 (comment)

See also: #95, #138

@Sechorda
Copy link
Author

how do I enable 'mode:'?

By setting the correct value which can be "pattern", proxy/port, or URL. See #159 (comment)

See also: #95, #138

Ok, What would be the easiest way to get the proxy listed in foxyproxys?
I am building a OS by script/debootstrap and just need to have a correct policy or strategy to have this proxy configured

Thank you

@erosman
Copy link
Collaborator

erosman commented Oct 17, 2024

The FoxyProxy enterprise policy resembles the FoxyProxy preferences export.

"mode" is the same.
"data" is the same.

Here is an example:

{
  "policies": {
    "3rdparty": {
      "Extensions": {
        "[email protected]": {
          "mode": "127.0.0.1:8080",
          "data": [
            {
              "active": true,
              "title": "Caido",
              "type": "http",
              "hostname": "127.0.0.1",
              "port": "8080",
              "username": "",
              "password": "",
              "cc": "",
              "city": "",
              "color": "#ff4500",
              "pac": "",
              "pacString": "",
              "proxyDNS": true,
              "include": [],
              "exclude": []
            }
          ]
        }
      }
    }
  }
}

@Sechorda
Copy link
Author

Sechorda commented Oct 17, 2024

The FoxyProxy enterprise policy resembles the FoxyProxy preferences export.

"mode" is the same. "data" is the same.

Here is an example:

Thanks for this snippet!

If I set active: false does this mean it will be disabled and I can select it and disable it at-will, or is it always on?

@erosman
Copy link
Collaborator

erosman commented Oct 17, 2024

If I set active: false does this mean it will be disabled and I can select it and disable it at-will, or is it always on?

If "mode" is set to an inactive proxy, the FoxyProxy will be set to disable.
It is better to change to mode to disable FoxyProxy.

"active" is used when user has many proxies and wants to disabled some to keep the UI less overcrowded.
Another use for "active" is when user wants to disable associated patterns for "Proxy by Patterns".

@Sechorda
Copy link
Author

If I set active: false does this mean it will be disabled and I can select it and disable it at-will, or is it always on?

If "mode" is set to an inactive proxy, the FoxyProxy will be set to disable. It is better to change to mode to disable FoxyProxy.

"active" is used when user has many proxies and wants to disabled some to keep the UI less overcrowded. Another use for "active" is when user wants to disable associated patterns for "Proxy by Patterns".

What options should I use is I want to be able to disable proxy, and select the one I set by policy?

@erosman
Copy link
Collaborator

erosman commented Oct 17, 2024

If you are using CLI (or anything other than the UI), there is no need to change the "active" state of a proxy.
You can add as many proxies as you need.
You only need to change the "mode" e.g. switch between:

  • 'disable" which means no proxy
  • "hostname:port" of the selected proxy

@Sechorda
Copy link
Author

If you are using CLI (or anything other than the UI), there is no need to change the "active" state of a proxy. You can add as many proxies as you need. You only need to change the "mode" e.g. switch between:

  • 'disable" which means no proxy
  • "hostname:port" of the selected proxy

which option allows me start with a proxy in the settings, and the proxy disabled. I can select it when needed, but it is off by default?

@erosman
Copy link
Collaborator

erosman commented Oct 18, 2024

which option allows me start with a proxy in the settings, and the proxy disabled. I can select it when needed, but it is off by default?

As I have already mentioned, "mode".
"mode" controls the proxying.

@Sechorda
Copy link
Author

Sechorda commented Oct 18, 2024

which option allows me start with a proxy in the settings, and the proxy disabled. I can select it when needed, but it is off by default?

As I have already mentioned, "mode". "mode" controls the proxying.

We have to agree that the example provided and the incomplete sentence in the Mozilla docs that documents each Key:value pair is not intuitive to even a seasoned techie.

You mentioned "mode": should be 127.0.0.1:8080. does this mean the proxy is always on?
If I switch "mode": to disable, where do I specify the proxy that I want available?

I hope my objective is clear, to have a proxy available to be chosen, but disabled by default. Can you please help me by providing an example snippet with this configuration?

Thank you

@erosman
Copy link
Collaborator

erosman commented Oct 18, 2024

You mentioned "mode": should be 127.0.0.1:8080. does this mean the proxy is always on?

Yes... that is the purpose of Enterprise Policy. It controls the extension and it is fixed.
Enterprise Policy is read by the extension on browser start up and it is not possible to change it.

Please read more on the function of the Enterprise Policy. Enterprise Polices are advanced features meant for administrators.

storage
Managed data declares the enterprise policies supported by the app. Policies are analogous to options but are configured by a system administrator instead of the user, enabling the app to be configured for all users of an organization.

If I switch "mode": to disable, where do I specify the proxy that I want available?

All "active" proxies are available to the extension but only the one set in the "mode" is used (unless "Proxy by Patterns) is used). You can have 100s of them listed in the "data".
Proxies can not be used when "mode" is set to disable. In this case FoxyProxy is disabled which means no proxying at all.

@Sechorda
Copy link
Author

All "active" proxies are available to the extension but only the one set in the "mode" is used (unless "Proxy by Patterns) is used).

Why would you be able to list more than one proxy if only one can be used and is always on by default? How can I achieve my goal of setting one proxy, not on by default - but able to be selected.

Essentially I would like to script the adding of a proxy as if it were done in the GUI, is it possible?

@Sechorda
Copy link
Author

You mentioned "mode": should be 127.0.0.1:8080. does this mean the proxy is always on?

Yes... that is the purpose of Enterprise Policy. It controls the extension and it is fixed. Enterprise Policy is read by the extension on browser start up and it is not possible to change it.

Please read more on the function of the Enterprise Policy. Enterprise Polices are advanced features meant for administrators.

storage
Managed data declares the enterprise policies supported by the app. Policies are analogous to options but are configured by a system administrator instead of the user, enabling the app to be configured for all users of an organization.

If I switch "mode": to disable, where do I specify the proxy that I want available?

All "active" proxies are available to the extension but only the one set in the "mode" is used (unless "Proxy by Patterns) is used). You can have 100s of them listed in the "data". Proxies can not be used when "mode" is set to disable. In this case FoxyProxy is disabled which means no proxying at all.

I just did a quick test, and my proxy is showing up in the 'proxy' tab under options, and the title of the proxy is hovering above the extension, but it's not listed in the proxy list and when I enable it, nothing happens.

@erosman
Copy link
Collaborator

erosman commented Oct 18, 2024

Why would you be able to list more than one proxy if only one can be used and is always on by default?

I only pointed out the possibilities. I am not aware of your settings.
In UI, you can switch between available proxies.
"Proxy by Patterns" utilises multiple proxies at the same time, for different sites.

How can I achieve my goal of setting one proxy, not on by default - but able to be selected.

Use the User Interface.
Enterprise Policy is used for fixed/unchangeable options.

I just did a quick test, and my proxy is showing up in the 'proxy' tab under options, and the title of the proxy is hovering above the extension, but it's not listed in the proxy list and when I enable it, nothing happens.

Only "active" proxies show in the toolbar popup UI.
When Enterprise Policy is used, users can not change FoxyProxy settings any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: import Import related issues general help General Help queries
Projects
None yet
Development

No branches or pull requests

2 participants