• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

how to access https site from javascript socket object

Community Beginner ,
May 28, 2015 May 28, 2015

Copy link to clipboard

Copied

HI ,

I'm new to SSL's and scripting.

I have written code to access http site and it is working.Below is the code.The script is failing when i try to access https application.

Can some one please help me .

below is the code.

var request = [];

    request.push('POST', ' ', path, ' ', "HTTP/1.1\n");       

    request.push('Authorization:', 'Basic d2NhZG1pbjp3Y2FkbWlu==', '\n');

    request.push('Host: ', host, "\r\n");

    request.push('User-Agent: ', USER_AGENT, "");

    //request.push('Connection: ', 'close', "\n");

    request.push('Pragma: ', "no-cache", "\r\n");

    request.push('Accept: ', "*/*", "\r\n");

    request.push('Accept-Charset: ', "UTF-8", "\r\n");

    request.push('Accept-Language: ', "en-US", "\r\n");

    request.push('Content-Language: ', "en-US", "\r\n");

    request.push('content-location: ', file.name, "\r\n");

    //request.push('Content-Length: ', fileContents.length, "\r\n");

    request.push('Content-Length: ', content.length, "\r\n");

    request.push('Content-Type: ', 'multipart/form-data;boundary=', boundary, "\r\n");

    

    request.push('\n');

    request.push(content);       

      alert('request--->'+request); 

    //  5. Upload

    var socket = new Socket;   

    socket.open(host+':80', 'BINARY');

    for (var i = 0; i < request.length; ++ i) {

        socket.write(request);

    }

TOPICS
Scripting

Views

3.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
May 28, 2015 May 28, 2015

Copy link to clipboard

Copied

Unfortunately, Illustrator not supported Socket Object.


Ten

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 03, 2015 Jun 03, 2015

Copy link to clipboard

Copied

HI Ten,

Thanks for responding.

I'm using bridge and able to access http URL.the moment i access https it is breaking.

Do we have any work around or solution to access https URL.

Please help .

Regards.

Venkat

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 03, 2015 Jun 03, 2015

Copy link to clipboard

Copied

You need to implement TLS, Can find some solutions in GitHub.

However, We can use Adobe Extension SDK, Provide to make Extensions HTML5+NODE.js with Extendscript. NODE.js includes HTTPS protocol and easy to use. You can reference below:

Adobe-CEP/CEP-Resources · GitHub

Ten

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

Hi Ten,

is there any other option in illustrator instead of socket?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

If you are familiar with C++, You can make HTTP Client External Object.

Please refer basicexternalobject project under the ./Adobe EXtendScript Toolkit CC/SDK/Samples/cpp/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 05, 2015 Jun 05, 2015

Copy link to clipboard

Copied

Hi Ten,

Thanks for your time.

Sorry I'm confused totally .Let me rephrase the issue im facing.

I'm executing the script from AI.The script starts Bridge and connects to the external application(Once connected takes input as AI file and send request  request  in Socket object) .

This is working for http .failing when i try to access https.

Is there any way to implement https access in the script it self without modifying in external Server.Seems Adobe Extension SDK with this ,i have to re-Implement totally.

Please suggest I need something which can be executed from AI .

Regards,Venkat

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 07, 2015 Jun 07, 2015

Copy link to clipboard

Copied

We can write HTTPS Socket logic with Extendscript and Bridgetalk, Need to impliment  "Handshake encripted stream" > "Build HTTP headder" > "encrypt with private key" > "pass encrypted headder" > "build body and encrypt"...

Its very bother for me. I often to use Adobe Extension SDK like previouse case.

However, you can read as reference HTTP over TLS:

http://www.infoq.com/articles/HTTPS-Connection-Jeff-Mose

In AdobeExtensionSDK, We can impliment HTTPS process with node.js and NPM packages, and main logic(working with Illustrator Objects) still Extendscript. You only need to rewrite socket manipuration and its very easy in NODE.js.

Ten

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

LATEST

Hi Venkat,

do you think a HTML panel would fit your needs? You need to send event from extendscipt and handle it in the panel. There it would be jast ajax to a https server

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines