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

feature_request(port): Force port #150

Open
Kristinita opened this issue Mar 26, 2018 · 0 comments
Open

feature_request(port): Force port #150

Kristinita opened this issue Mar 26, 2018 · 0 comments

Comments

@Kristinita
Copy link

Kristinita commented Mar 26, 2018

1. Summary

It would be nice, if would be possible force use specific port, even if another program already use this port.

2. Environment

  • grunt 1.0.2,
  • grunt-browser-sync 2.2.0,
  • Sublime Text Build 3143,
  • SublimeServer 0.3.3.

3. Argumentation

I use SublimeServer for simply opening my HTML files in localhost. I open HTML file in Sublime Text → I run command sublimeserver_browser → HTML file open in browser in format:

http://localhost:3000/path/to/file.html

If I use SublimeServer, I can't make, that BrowserSync force have same port as SublimeServer. I need manually change port number in URL bar for each file. It may take a lot of time.

4. Steps to reproduce

I run SublimeServer in port 3000 → I run grunt-browser-sync in port 3000.

5. Expected behavior

For example, if force_port: true in BrowserSync settings:

Port 3000.

D:\Kristinita>grunt browserSync
Running "browserSync:bsFiles" (browserSync) task
[BS] [HTML Injector] Running…
[Browsersync] Access URLs:
 -------------------------------------
       Local: http://localhost:3000
    External: http://192.168.56.1:3000
 -------------------------------------
          UI: http://localhost:3001
 UI External: http://192.168.56.1:3001
 -------------------------------------
[Browsersync] Serving files from: ../
[Browsersync] Watching files…

6. Actual behavior

Port 3001.

D:\Kristinita>grunt browserSync
Running "browserSync:bsFiles" (browserSync) task
[BS] [HTML Injector] Running…
[Browsersync] Access URLs:
 -------------------------------------
       Local: http://localhost:3001
    External: http://192.168.56.1:3001
 -------------------------------------
          UI: http://localhost:3002
 UI External: http://192.168.56.1:3002
 -------------------------------------
[Browsersync] Serving files from: ../
[Browsersync] Watching files…

7. Not helped

I try:

  1. Set port: 3000 in Gruntfile settings,
  2. Change port number in SublimeServer settings.

I can't make, that SublimeServer and BrowserSync have same ports.

Also:

  1. I stop SublimeServer → I run BrowserSync in port 3000 → I run SublimeServer in port 3000 → BrowserSync not synced my files.

Thanks.

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

1 participant