Skip to content

How to set the http request port to another value? #79

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

Closed
ericksprengel opened this issue Aug 8, 2012 · 3 comments
Closed

How to set the http request port to another value? #79

ericksprengel opened this issue Aug 8, 2012 · 3 comments

Comments

@ericksprengel
Copy link

I'd like to configure the port to another value.
I want to set the port to 3000, but I noticed that this value 80 is hardcoded.

@MarkVaughn
Copy link

Would this cause for headers not being sent properly? also using node

@cgringmuth
Copy link

I also have same problem. I want to change the port to 8080. Is there any issue I should keep mind when changing the port?

Regarding to change the port, I think, it should be easy to adjust the code accordingly? Hence, changing the constructor of AsyncHttpClient should do the trick or? Something like:

public AsyncHttpClient() {
    this(80);
}

/**
* Creates a new AsyncHttpClient.
*/
public AsyncHttpClient(int httpPort) {
    ....
    schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), httpPort));
    ....
}

I haven't tested the code yet.

@smarek
Copy link
Member

smarek commented Oct 13, 2013

Good point, I've committed option to change HTTP and HTTPS ports via constructor.

@smarek smarek closed this as completed Oct 13, 2013
iNdieboyjeff pushed a commit to iNdieboyjeff/android-async-http that referenced this issue Oct 14, 2013
# By mareksebera (51) and Marek Sebera (2)
# Via mareksebera
* 'master' of https://github.com/loopj/android-async-http: (53 commits)
  Handy method to specify charset in anonymous inner instances
  Sample Application initial state
  Removed unnecessary dependency, android-async-http#168
  Javadoc formatting
  Fixed 2d34e1c leftover, Closes android-async-http#86
  Fixing android-async-http#79, Allowing non-standard HTTP and HTTPS ports
  Added warning about SSL bypass fix
  Related to android-async-http#67, avoiding NPE in JsonHttpResponseHandler
  Fixes android-async-http#61, allow removing of Basic Auth credentials
  Compatibility changes fix
  Fixes android-async-http#14
  Fixes android-async-http#143
  android-async-http#88 uncatched exception
  Closes android-async-http#266
  Closes android-async-http#283
  Fixes android-async-http#286
  Fixes android-async-http#294
  Fixes android-async-http#287
  Fixes android-async-http#295
  Added Maven description to README file [skip ci]
  ...

Conflicts:
	.classpath
	build.gradle
	project.properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants